Installation
Requirements
Make sure you have the following:
- A Linux server
- Python 3 installed
- A domain name with DNS control
- Root or sudo access
- Nginx installed
- Certbot installed (for SSL certificates)
- Working
.envfile, you can read how you can make one here
DNS Setup
Create the following DNS records pointing to your server IP:
pages.yourdomain.com -> YOUR_SERVER_IP
*.pages.yourdomain.com -> YOUR_SERVER_IP
Both records are required for wildcard subdomains to function.
Nginx Configuration
Create a new config file:
sudo nano /etc/nginx/sites-available/tuxforge-pages
Add the following configuration:
server {
listen 80;
server_name pages.yourdomain.com *.pages.yourdomain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name pages.yourdomain.com *.pages.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/pages.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/pages.yourdomain.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:8082;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_ssl_verify off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}
Important:
- Replace
pages.yourdomain.comwith your actual domain - Make sure the SSL certificate paths match your setup
- Make sure the port (8082) matches the port used by TuxForge Pages
Enable the configuration:
sudo ln -s /etc/nginx/sites-available/tuxforge-pages /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
SSL Setup with Certbot
Request a wildcard certificate:
sudo certbot certonly --manual --preferred-challenges dns \
-d pages.yourdomain.com \
-d "*.pages.yourdomain.com"
Follow the instructions and create the required DNS TXT records.
After completion, certificates will be stored in:
/etc/letsencrypt/live/pages.yourdomain.com/
Make sure the paths in your Nginx config match this location.
Running TuxForge Pages
Start manually:
python3 main.py
Systemd Service (Recommended)
Create a service file:
sudo nano /etc/systemd/system/tuxforge-pages.service
Add:
[Unit]
Description=Tuxforge Pages Service
After=network.target
[Service]
User=root
WorkingDirectory=/opt/tuxforge-pages
ExecStart=/usr/bin/python3 /opt/tuxforge-pages/main.py
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
Important:
- Replace
/opt/tuxforge-pageswith your actual installation path - Ensure Python path is correct (
which python3)
Enable and start the service:
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable tuxforge-pages
sudo systemctl start tuxforge-pages
Check status:
sudo systemctl status tuxforge-pages
Testing
Open in browser:
https://pages.yourdomain.com
https://test.pages.yourdomain.com
If configured correctly, the service should respond.
Troubleshooting
Check Nginx configuration:
sudo nginx -t
Check service logs:
journalctl -u tuxforge-pages -f
Check if the application is running on the correct port:
ss -tulnp | grep 8080
Common issues:
- DNS records not set correctly
- Wrong domain in Nginx config
- SSL certificate paths incorrect
- Wrong working directory or Python path
Notes
- Using a non-root user is recommended for security
- Ensure firewall rules allow ports 80 and 443
- Ensure the application port (e.g. 8080) is accessible locally
Done
TuxForge Pages should now be running behind Nginx with SSL enabled.