INSTALLING P2 SERVER ON UBUNTU
The package is a single native P2 Server program with no extra runtime required; the install script sets up PostgreSQL, a system user and the systemd service.
1. Requirements
- Ubuntu Server 24.04 LTS or newer, x86-64
- A user with
sudorights - At least 2 GB of RAM and 10 GB of free disk space
- Access to ports 80/443 for the domain and HTTPS
2. Download and verify the package
curl -LO https://p2.tdagaming.net/downloads/P2-Server-Ubuntu-24.04-x64-1.0.9.tar.gz curl -LO https://p2.tdagaming.net/downloads/P2-Server-Ubuntu-24.04-x64-1.0.9.tar.gz.sha256 sha256sum -c P2-Server-Ubuntu-24.04-x64-1.0.9.tar.gz.sha256
3. Run the installer
tar -xzf P2-Server-Ubuntu-24.04-x64-1.0.9.tar.gz cd P2-Server-Ubuntu-24.04-x64-1.0.9 sudo bash install.sh
The script asks Bu makinedeki PostgreSQL kullanılsın mı? [E/h] (Use PostgreSQL on this machine? [Y/n]); answer E (yes), then choose a strong database password and leave the API port at the default 4000. The installer creates:
- Application:
/opt/p2-server - Data:
/var/lib/p2-server - Secret settings:
/etc/p2-server/p2-server.env - Service:
p2-server.service
If you are upgrading an earlier P2 Server installation, run the same commands: the database connection, JWT keys, port and uploaded files are kept, and database migrations are applied automatically. Taking a backup with
sudo p2-serverctl backup before upgrading is recommended.4. Manage the server
sudo p2-serverctl status sudo p2-serverctl logs sudo p2-serverctl restart
The installer enables the service automatically. To check after a reboot:
systemctl is-enabled p2-server systemctl is-active p2-server curl http://127.0.0.1:4000/health
5. Publish over HTTPS with Caddy
sudo apt install caddy sudo nano /etc/caddy/Caddyfile
p2.example.com {
reverse_proxy 127.0.0.1:4000
}sudo caddy validate --config /etc/caddy/Caddyfile sudo systemctl reload caddy sudo ufw allow 80/tcp sudo ufw allow 443/tcp
Do not expose PostgreSQL's port
5432 to the internet. Restrict the P2 API's port 4000 with the firewall so that only the reverse proxy can reach it.6. Connect the client
Download the Windows client and enter https://p2.example.com on first launch. The first account becomes the organisation's first administrator.
7. Back up and restore
sudo p2-serverctl backup sudo p2-serverctl restore /backups/P2-Server-Backup.p2backup
Don't leave backups on the same machine; copy them regularly to another disk or to encrypted remote storage.