Self-host an IoT server on Ubuntu
You can run the Plynx server on a small Ubuntu VPS or on a machine at home. Your ESP32 and ESP8266 boards connect to that server, and Plynx uses it for dashboards, widget state and project history.
This guide has two installation paths. Choose the VPS path if you have a public IP address and a domain. Choose the local path if the server stays on your home network or you reach it through Tailscale. Follow one path only.
If you are using a Raspberry Pi, follow the Raspberry Pi guide. This article assumes Ubuntu 22.04 or 24.04 on a VPS, home server or NAS.
How the setup works
The installation has three parts.
- Your boards connect to the server on port 8080, or on port 8441 when you use TLS for hardware traffic.
- The server runs as one JAR file. It stores projects, widget state and history in its data directory. It is a GPL-3.0 fork of the final open source Blynk local server release, version 0.41.18. The source and release files are at github.com/NickP005/plynx-server.
- Your iPhone runs Plynx and connects to the same server to display and control your projects.
You do not need an external Plynx cloud account for this setup.
What you need
- A machine running Ubuntu 22.04 or 24.04. A small VPS or a home server is enough for a personal project. One CPU and 1 GB of RAM are a practical starting point.
- SSH access to that machine through an account that can run
sudo. - For a VPS, a domain name that can point to the server with an A record.
- For a home server, its LAN address. Tailscale is optional if you want to reach Plynx while away from home.
Run the commands below in an SSH session on the server. Do not run them on your laptop.
Path A: a VPS with a public domain
Replace iot.example.com with your domain and you@example.com with the
email address you want to use for Let’s Encrypt.
1. Install Java and the required tools
sudo apt update && sudo apt upgrade -y
sudo apt install -y default-jre-headless ufw curl wget
java -versionPlynx needs Java 11 or later. Continue when java -version prints a version
number.
2. Point your domain to the VPS
Create an A record for iot.example.com that points to the public IP
address of your VPS. Confirm that DNS has updated before requesting a
certificate.
getent hosts iot.example.comThe returned address must match your server’s public IP.
3. Open the firewall
You need SSH plus three Plynx service ports. Port 8080 accepts plain TCP hardware traffic, port 8441 accepts TLS hardware traffic and port 9443 serves the app over HTTPS.
sudo ufw allow OpenSSH
sudo ufw allow 8080/tcp comment 'Plynx hardware plain'
sudo ufw allow 8441/tcp comment 'Plynx hardware TLS'
sudo ufw allow 9443/tcp comment 'Plynx app HTTPS'
sudo ufw --force enable
sudo ufw status numbered4. Request a Let’s Encrypt certificate
Certbot can temporarily listen on port 80 to verify your domain.
sudo apt install -y certbot
sudo ufw allow 80/tcp
sudo certbot certonly --standalone --non-interactive --agree-tos \
-m you@example.com -d iot.example.com
sudo ufw delete allow 80/tcpThe certificate files should now be in /etc/letsencrypt/live/iot.example.com/.
5. Create the service account and download the server
sudo useradd --system --create-home --home-dir /opt/plynx --shell /usr/sbin/nologin plynx
sudo mkdir -p /opt/plynx/data
sudo wget -O /opt/plynx/plynx-server.jar \
https://github.com/NickP005/plynx-server/releases/download/v0.41.18/plynx-server-0.41.18.jar
sudo chown -R plynx:plynx /opt/plynx6. Add the server configuration
Create a properties file that points Plynx at your certificate and data
directory. Replace you@example.com with the email address that can create
the first account.
sudo tee /opt/plynx/server.properties > /dev/null <<'EOF'
server.ssl.cert=/etc/letsencrypt/live/iot.example.com/fullchain.pem
server.ssl.key=/etc/letsencrypt/live/iot.example.com/privkey.pem
server.ssl.key.pass=
allowed.users.list=you@example.com
admin.rootPath=/admin
data.folder=/opt/plynx/data
enable.raw.db.data.store=true
EOF
sudo chown plynx:plynx /opt/plynx/server.propertiesLet’s Encrypt private keys are owned by root. Give the plynx service
account read access to the certificate files.
sudo chmod 0755 /etc/letsencrypt/live /etc/letsencrypt/archive
sudo chmod 0640 /etc/letsencrypt/live/iot.example.com/*.pem \
/etc/letsencrypt/archive/iot.example.com/*.pem
sudo chgrp -R plynx /etc/letsencrypt/live /etc/letsencrypt/archive7. Create the systemd service
sudo tee /etc/systemd/system/plynx-server.service > /dev/null <<'EOF'
[Unit]
Description=Plynx IoT server
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=plynx
Group=plynx
WorkingDirectory=/opt/plynx
ExecStart=/usr/bin/java -jar /opt/plynx/plynx-server.jar \
-serverConfig /opt/plynx/server.properties \
-dataFolder /opt/plynx/data
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now plynx-server
sleep 2
systemctl status plynx-server --no-pagerThe service should report active (running). Its startup log lists the
hardware and app ports.
8. Check the server from another machine
Run this command from your laptop.
curl -sSI https://iot.example.com:9443/admin | head -n 1An HTTP response confirms that the server is reachable. If the command
hangs, check the VPS firewall. If TLS fails, check the certificate paths in
server.properties.
9. Restart Plynx after certificate renewal
Certbot installs its own renewal timer. Add a deploy hook so Plynx loads the renewed certificate.
sudo mkdir -p /etc/letsencrypt/renewal-hooks/deploy
sudo tee /etc/letsencrypt/renewal-hooks/deploy/plynx.sh > /dev/null <<'EOF'
#!/bin/sh
systemctl restart plynx-server
EOF
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/plynx.sh
sudo systemctl list-timers | grep certbotThe restart normally takes a few seconds. Certificate renewals run every ninety days.
Path B: a local Ubuntu server or NAS
This path keeps the server on your LAN. It does not need a public IP address or a domain. You can add Tailscale to reach it securely from outside your home.
1. Install Java and the firewall
sudo apt update && sudo apt upgrade -y
sudo apt install -y default-jre-headless ufw curl wget2. Create the service account and download the server
sudo useradd --system --create-home --home-dir /opt/plynx --shell /usr/sbin/nologin plynx
sudo mkdir -p /opt/plynx/data
sudo wget -O /opt/plynx/plynx-server.jar \
https://github.com/NickP005/plynx-server/releases/download/v0.41.18/plynx-server-0.41.18.jar
sudo chown -R plynx:plynx /opt/plynx3. Create the local systemd service
Plynx creates a self-signed certificate on its first start. The app can accept that certificate for a server on your LAN.
sudo tee /etc/systemd/system/plynx-server.service > /dev/null <<'EOF'
[Unit]
Description=Plynx IoT server
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=plynx
Group=plynx
WorkingDirectory=/opt/plynx
ExecStart=/usr/bin/java -jar /opt/plynx/plynx-server.jar -dataFolder /opt/plynx/data
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now plynx-server
sleep 2
systemctl status plynx-server --no-pager4. Allow connections from your LAN
Replace 192.168.1.0/24 with your own subnet.
sudo ufw allow OpenSSH
sudo ufw allow from 192.168.1.0/24 to any port 8080 proto tcp comment 'Plynx hardware'
sudo ufw allow from 192.168.1.0/24 to any port 9443 proto tcp comment 'Plynx app'
sudo ufw --force enable5. Use Tailscale for remote access (optional)
Install Tailscale on the Ubuntu server and on your iPhone. This gives you a private address without opening a port on your router.
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
tailscale ip -4Note the Tailscale address, which looks like 100.x.y.z. Use that address
in Plynx when you are away from home. Boards on the home network can keep
using the LAN address.
Connect Plynx and your boards
The app
Install Plynx from the App Store. On the sign-in screen, tap the server selector and enter the host and port for your installation.
- On a VPS, use
iot.example.comon port9443. - On a home server, use its LAN address or Tailscale address on port
9443.
Create an account. It is stored on your server. Then create a project, add
a Button widget on virtual pin V1 and copy the authentication token from
the project settings.
The board
In a Plynx sketch, pass your server host as the final argument to
Plynx.begin.
#define PLYNX_PRINT Serial
#include <WiFi.h>
#include <PlynxSimpleEsp32.h>
char auth[] = "YOUR_AUTH_TOKEN";
char ssid[] = "YOUR_WIFI";
char pass[] = "YOUR_WIFI_PASSWORD";
void setup() {
Serial.begin(115200);
Plynx.begin(auth, ssid, pass, "iot.example.com", 8080);
}
void loop() {
Plynx.run();
}
Install the Plynx library from the Arduino Library Manager and flash the board once over USB. Once it connects, tapping the button in Plynx sends the command through your server to the board.
Back up the data directory
Plynx stores its data in /opt/plynx/data. This script keeps one archive
for each day of the week and overwrites it the following week.
sudo tee /etc/cron.daily/plynx-backup > /dev/null <<'EOF'
#!/bin/sh
DEST=/var/backups/plynx
mkdir -p "$DEST"
tar czf "$DEST/plynx-data-$(date +%u).tar.gz" -C /opt/plynx data
find "$DEST" -type f -mtime +14 -delete
EOF
sudo chmod +x /etc/cron.daily/plynx-backup
Copy the resulting archives to another machine or backup service. A backup stored only on the server does not protect you from losing that server.
Maintain the host
The JAR does not update automatically. Keep Ubuntu patched, restart the server after relevant system updates and take a backup before you change its configuration.
sudo apt update && sudo apt upgrade
sudo systemctl restart plynx-server
Questions people ask
Do I need a domain name?
Only for the VPS path, and only if you want a proper TLS certificate. On a home server you can use the LAN address or a Tailscale address directly.
Can I run this in Docker?
Yes. The JAR runs unchanged in any container that provides Java 11 or later. Mount your data directory as a volume and expose ports 8080, 8441 and 9443.
What if my ISP blocks incoming connections?
Use the local path with Tailscale. Nothing on your router needs to be opened. Boards at home reach the server on the LAN; you reach it through the Tailscale address.
How much traffic does a hobby setup generate?
A dashboard with a handful of widgets and a few boards uses a few megabytes per day at most. The server idles around 200 MB of RAM and near zero CPU.
Can I move from a home server to a VPS later?
Yes. Copy the /opt/plynx/data directory to the new machine, install the JAR the same way and start the service. Your projects, tokens and history come with the data folder.
Does it speak MQTT?
No. Plynx uses its own binary protocol, which is what the app and the boards speak natively. If you need MQTT alongside, run a separate broker and bridge with a small script.
Is the server actively maintained?
The server version is frozen at 0.41.18 on purpose: it is the last release of a mature line and it works. Security updates come from Ubuntu itself. The client, the app you use every day, is what keeps evolving.
What you now control
Your boards, server, dashboards and project history now run on infrastructure you choose. A local installation continues to work on the LAN when the internet connection is unavailable.
Plynx is free on the App Store. Point it at the server you set up and use it to build dashboards for your own projects.