|
<< Click to Display Table of Contents >> Manual installation |
![]() ![]()
|
Manual installation of the TeslaCloud Standalone Server provides full control over the installation and configuration process.
This method is intended for system administrators and advanced users who require custom configuration or integration with existing infrastructure.
The installation is performed step by step using standard Linux tools and services.
Before installing TeslaCloud, update the operating system and install the required utilities.
sudo apt update && sudo apt upgrade -y
sudo apt install -y unzip curl wget gnupg2 ca-certificates lsb-release
TeslaCloud requires Java 8. OpenJDK 8 is recommended. Other compatible JDK distributions may also be used if required.
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt install -y openjdk-8-jdk
Install PostgreSQL and additional database utilities.
sudo apt install -y postgresql postgresql-contrib
Open the PostgreSQL console:
sudo -u postgres psql
Create the database and user for TeslaCloud:
CREATE DATABASE teslacloud;
CREATE USER tesla WITH PASSWORD '123456';
ALTER USER tesla WITH SUPERUSER;
\q
sudo mkdir -p /opt/servercloud
sudo chown $USER:$USER /opt/servercloud
cd /opt/servercloud
wget https://teslascada.com/Downloads/servercloud.zip
unzip servercloud.zip
rm servercloud.zip
sudo useradd -r -s /bin/false servercloud
sudo chown -R servercloud:servercloud /opt/servercloud
sudo mkdir -p /home/servercloud/.java/.userPrefs
sudo chown -R servercloud:servercloud /home/servercloud/.java
sudo chmod -R 700 /home/servercloud/.java
Create the service file:
/etc/systemd/system/servercloud.service
Service configuration:
[Unit]
Description=TeslaCloud
After=network.target postgresql.service
[Service]
Type=simple
User=servercloud
WorkingDirectory=/opt/servercloud
ExecStart=/usr/bin/java -jar servercloud.jar
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable servercloud
sudo systemctl start servercloud
sudo systemctl status servercloud
journalctl -u servercloud -f
sudo apt install -y nginx
Configuration file:
/etc/nginx/sites-available/servercloud
Example configuration:
server {
listen 80;
server_name domain.com;
root /opt/servercloud/html;
index index.html;
location /mqtt {
if ($http_upgrade != "websocket") {
return 444;
}
proxy_pass http://127.0.0.1:1884/mqtt;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400;
proxy_send_timeout 86400;
}
location /external/api {
proxy_pass https://127.0.0.1:8090/external/api;
}
location / {
try_files $uri $uri/ /index.html;
}
}
sudo ln -s /etc/nginx/sites-available/servercloud /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo rm /etc/nginx/sites-enabled/default
sudo usermod -aG servercloud user
sudo chown -R servercloud:servercloud /opt/servercloud
sudo chmod -R 775 /opt/servercloud
After completing all steps, TeslaCloud Standalone Server is installed and running as a background service.
The system is accessible through a web browser and operates entirely on the local server.
For a faster and simpler deployment, refer to the Automatic Installation section.