Skip to content

Running the panel on the VPS

Day-to-day work after installation: updating, useful commands, where the files live and how to change the terminal user or the panel port. All commands run on the VPS, connected over SSH with your user, inside /opt/tws-panel.

A single line, on the VPS:

Terminal window
cd /opt/tws-panel && sudo git pull && sudo git log --oneline -1 && sudo docker compose up -d --build

git log --oneline -1 shows the commit that went live, so you can check it. Your projects, domains, email and the administrator account stay as they were. What changed in each version is in the CHANGELOG.

SituationCommand (in /opt/tws-panel)Guide
Lost the setup tokensudo ./scripts/show-token.shInstallation
Want to redo the wizardsudo ./scripts/reset-setup.sh (--full also deletes the admin account)Recover access
Lost your phone and the two-factor authentication codessudo ./scripts/reset-2fa.shRecover access
Disabled access by IP and the panel domain stopped openingsudo ./scripts/reativar-acesso-ip.shFeatures
The panel does not open and you have a .7z backup of itsudo ./scripts/restaurar-painel.sh /root/ARQUIVO.7zFeatures
Want to remove the panel./scripts/uninstall.sh --dry-run and then ./scripts/uninstall.shInstallation

Each project you deploy has its own folder on the server, with the code cloned from Git (in src/) and the files the panel generates around it (such as repo.git and paas.env). By default these folders live in /opt/tws-projects — next to /opt/tws-panel, and outside any /home, so they do not disappear if you ever delete a Linux user.

They live in a real directory on the VPS, not hidden inside the container, for two practical reasons:

  • You can look at them. Connected over SSH, ls /opt/tws-projects already shows everything; you can read a log, copy a file or take a backup with the usual tools.
  • Projects that write files work. If your project’s docker-compose.yml has a line like ./dados:/app/dados (to keep uploads, a SQLite database, whatever), the one looking for that dados folder is Docker on the VPS, not the panel. If it existed only inside the panel’s container, Docker would create an empty folder and your project would come up without its data. That is why the path is exactly the same inside and outside.

Want to use another location (a larger disk mounted at /mnt/dados, for example)? Choose it at install time:

Terminal window
./scripts/install.sh --projects-dir=/mnt/dados/projetos

The user the terminal opens as and the mode (senha or segundo-plano) are stored in the .env file in /opt/tws-panel. To change them, run the installer again asking it to prompt you once more:

Terminal window
cd /opt/tws-panel
./scripts/install.sh --reconfigure-terminal

It asks the same questions again, validates the answer and recreates the panel with the new choice. Your projects, domains, email and the administrator account are not touched — it is the same safe reinstall as always. If you would rather not answer anything, pass the values directly:

Terminal window
./scripts/install.sh --terminal-user=OUTRO_USUARIO --root-mode=segundo-plano

It only matters for tunnel access. With HTTPS access (the default) this port is internal — the panel listens only inside the VPS and the proxy serves the outside world, on ports 80/443 — and the installer picks it by itself.

With tunnel access, the port is the one you chose at installation (default 9000) and it is stored in the PAAS_PORT= line of the .env in /opt/tws-panel. To change it, run the installer again passing the new one:

Terminal window
cd /opt/tws-panel
./scripts/install.sh --port=9500

It checks that the new port is free, rejects the ones that would break the panel (22, 80, 443 and the mail ports), recreates the container and prints the tunnel command with the right number already in it. Your projects, domains, email and the administrator account are not touched.

Terminal window
sudo docker compose ps # panel status
sudo docker compose logs -f panel # real-time logs
sudo docker compose up -d --build # update to a new version (git pull first)
sudo ./scripts/show-token.sh # shows the URL + setup token again (if you lost the token)
sudo ./scripts/reset-setup.sh # restarts the wizard from scratch (--full also deletes users/sessions)
./scripts/install.sh --reconfigure-terminal # changes the panel's terminal user/mode
./scripts/install.sh --port=9500 # changes the panel port on the VPS
./scripts/uninstall.sh --dry-run # shows what removing the panel would delete