Guide to Deploying a Professional IoT Dashboard with ThingsBoard on VPS
A detailed guide to deploying a professional IoT dashboard using ThingsBoard on a VPS. Covers server configuration, ThingsBoard installation, device connectivity, creating visual...
Introduction to ThingsBoard and IoT Dashboard Deployment Needs
ThingsBoard is an open-source IoT device management platform that enables real-time data collection, processing, and visualization from IoT devices. With its intuitive dashboard interface, ThingsBoard allows small and medium-sized businesses to build professional IoT monitoring and control systems without investing in expensive hardware.
Deploying ThingsBoard on a VPS (Virtual Private Server) is an ideal choice because it offers full control, high flexibility, and lower operational costs compared to cloud-based solutions. This guide walks you through the steps to deploy a professional IoT dashboard with ThingsBoard on a VPS running Ubuntu.
Requirements and VPS Configuration
To deploy ThingsBoard effectively, you need a VPS with the following minimum configuration:
- OS: Ubuntu 20.04 or 22.04 LTS
- RAM: at least 4GB (recommended 8GB for high device load)
- Storage: 20GB SSD or larger
- Processor: 2 or more cores
- Public IP and open ports (80, 443, 8080)
You can use high-RAM Cloud VPS solutions designed for self-hosted LLMs and API gateways, available at High-RAM Cloud VPS for Self-Hosted LLMs & API Gateways.
Deploying ThingsBoard on VPS
Follow these steps to install and configure ThingsBoard:
1. Update System and Install Java
# Update the system
sudo apt update && sudo apt upgrade -y
# Install OpenJDK 11
sudo apt install openjdk-11-jdk -y
2. Install PostgreSQL
ThingsBoard uses PostgreSQL as its database. Install and configure it as follows:
# Install PostgreSQL
sudo apt install postgresql postgresql-contrib -y
# Create user and database for ThingsBoard
sudo -u postgres psql -c "CREATE USER thingsboard WITH PASSWORD 'your_password';"
sudo -u postgres psql -c "CREATE DATABASE thingsboard WITH OWNER thingsboard;"
3. Download and Install ThingsBoard
# Download ThingsBoard package
wget https://github.com/thingsboard/thingsboard/releases/download/v3.5.2/thingsboard-3.5.2.deb
# Install the package
sudo dpkg -i thingsboard-3.5.2.deb
During installation, select PostgreSQL configuration and enter the database connection details.
4. Start the Service
# Start ThingsBoard
sudo service thingsboard start
# Check the status
sudo service thingsboard status
Creating Dashboards and Connecting Devices
Once ThingsBoard is running, access the web interface at http://your_vps_ip:8080 and log in with the default credentials:
- Username:
[email protected] - Password:
tenant
Follow these steps to create a dashboard:
- Create a new device from the Devices menu
- Set sensor parameters (e.g., temperature, humidity)
- Create a new dashboard from the Dashboards menu
- Add widgets (charts, gauges, indicators) and link them to device data
- Define alerts for threshold breaches
To connect devices, use protocols such as MQTT, HTTP, or CoAP. For example, with MQTT:
# Install MQTT client (e.g., mosquitto)
sudo apt install mosquitto-clients -y
# Send sample data
mosquitto_pub -h your_vps_ip -p 1883 -t "v1/devices/me/telemetry" -u "device_001" -m '{"temperature": 25, "humidity": 60}'
Performance Optimization and Security
To ensure stable and secure operation, perform the following steps:
- Set up SSL/TLS for the web interface using Let's Encrypt
- Optimize PostgreSQL with PgBouncer for handling thousands of connections (see Optimizing PostgreSQL Database with PgBouncer)
- Configure firewall (UFW) to allow only necessary ports
- Set up scheduled database backups
Troubleshooting and Activity Verification
Before deployment, verify the following:
- Ensure the VPS has internet connectivity and required ports are open
- Run the service status check:
sudo service thingsboard status - Access
http://your_vps_ip:8080to verify the web interface - Send sample data via MQTT to test data reception
If data does not appear, check the ThingsBoard logs:
sudo journalctl -u thingsboard -n 50 --no-pager
If database-related errors occur, verify PostgreSQL connection and user permissions.
References
High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache
Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.
VPS-4E
10% VAT included
- CPU: 4 vCPU
- RAM: 8 GB
- SSD: 50 GB NVMe
