Self-Hosting Guide
Deploy ExposeHost on your own infrastructure for full control and zero recurring costs.
Requirements
- A VPS with a public IP (DigitalOcean, Linode, AWS, Azure, etc.)
- A domain name with DNS access
- Python 3.11+
- nginx (for HTTP mode)
- SSL certificates (Let's Encrypt recommended)
Server Setup
1. Provision a VPS
Minimum specs: 1 vCPU, 1GB RAM, Ubuntu 22.04 LTS
2. Configure DNS
Point your domain and a wildcard subdomain to your server:
A @ → YOUR_SERVER_IP
A *.tunnel → YOUR_SERVER_IP
This allows subdomains like myapp.tunnel.yourdomain.com
3. Install dependencies
sudo apt update
sudo apt install python3 python3-pip nginx certbot python3-certbot-nginx
4. Clone ExposeHost
git clone https://github.com/frost2k5/ExposeHost.git
cd ExposeHost
5. Generate SSL certificates
# For the tunnel server itself
openssl genrsa -out ExposeHost/keys/test_private_key.pem 4096
openssl req -new -x509 -key ExposeHost/keys/test_private_key.pem \
-out ExposeHost/keys/test_certificate.pem -days 365
# For HTTPS on subdomains (using Let's Encrypt)
sudo certbot --nginx -d tunnel.yourdomain.com -d *.tunnel.yourdomain.com
6. Configure the server
Edit ExposeHost/server/constants.py:
DOMAIN_NAME = 'tunnel.yourdomain.com'
MAX_TIMEOUT = 5
7. Configure nginx
ExposeHost generates nginx configs automatically, but ensure the config directory exists:
mkdir -p ~/nginx
sudo ln -s ~/nginx /etc/nginx/sites-enabled/ExposeHost
8. Start the server
python server_cli.py
Running as a Service
# /etc/systemd/system/ExposeHost-server.service
[Unit]
Description=ExposeHost Server
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu/ExposeHost
ExecStart=/usr/bin/python3 server_cli.py
Restart=always
[Install]
WantedBy=multi-user.target
sudo systemctl enable ExposeHost-server
sudo systemctl start ExposeHost-server
Client Configuration
Update the client to connect to your server. In client_cli.py:
client = Client('127.0.0.1', port, "tunnel.yourdomain.com", 1435, proto, subdomain)
Architecture Notes
- The server uses multiprocessing for load balancing
- Worker count = 2 × CPU cores by default
- Main port (1435) is the load balancer; workers use ports 1436+
- nginx handles HTTPS termination for HTTP mode