Self-host ProxVN: complete server setup and operations
Run the public ProxVN 9.x server that connects visitors to your users’ local apps, with your own website and Console management page. This reference covers installation, daily operation, backups and recovery.
Do you need to self-host? If you only want to share an app, test a webhook or play with friends, start with the client tutorial; you can use the public ProxVN server without renting a VPS. Self-host when you want your own server/domain and are ready to maintain accounts, updates, security and backups. A VPS is an Internet-connected computer you rent from a hosting provider; its rental/domain costs are separate from the ProxVN software. The client runs on the computer containing your app. See the plain-language glossary for unfamiliar terms.
example.com, tunnel.example.com, documentation IP 203.0.113.10 and SSH user with your own values before running commands. Commands marked VPS run on the rented server; commands marked local run on the computer hosting your app. Choose either systemd or Docker for one server, not both on the same ports.1. Prepare a VPS and inspect existing services
The automatic installer supports Ubuntu/Debian with systemd on amd64 or arm64 and requires root through sudo. Use a publicly reachable VPS, a domain you control and an SSH session you can keep open. A small deployment can start with 1 GiB RAM, but measure your actual traffic, concurrent streams, disk space and backup needs; this is a starting recommendation, not a capacity guarantee.
VPS:
sudo apt-get update
sudo apt-get install -y curl ca-certificates openssl iproute2 dnsutils sqlite3 less
uname -m
free -h
df -h / /var
sudo ss -lntup
timedatectl status
Port 443 must be available to ProxVN. The installer refuses another owner on 443; it does not automatically move an existing HTTPS reverse proxy or share that listener. For an existing nginx on port 80, it can create a domain-specific HTTP bridge to 127.0.0.1:8880. Review its generated nginx configuration for conflicts with your own rules. Use a dedicated IP/VPS or design and test your own front proxy if 443 is already required by another site.
2. DNS and the two separate TLS certificates
DNS is the Internet’s address book: it connects a name such as example.com to a server IP. In this table, A means an IPv4 address, @ means the main domain and * covers names such as demo.example.com. HTTPS/TLS encrypts a connection; a trusted certificate lets the browser check the website’s identity. Here origin means your VPS and edge means Cloudflare’s public gateway in front of it.
For the simplest HTTPS setup, put the website and wildcard HTTP tunnels behind Cloudflare and point the tunnel control hostname directly to your VPS. Create these records, replacing the example IP:
| Record | Value | Cloudflare proxy |
|---|---|---|
A @ | 203.0.113.10 | Proxied for this Cloudflare setup |
A * | 203.0.113.10 | Proxied for HTTPS tunnel names |
A tunnel | 203.0.113.10 | DNS only |
Keep tunnel DNS only: the client needs direct TCP/UDP access on 8882 and public TCP/UDP tunnel ports. Do not leave an old AAAA record pointing to a different or unreachable IPv6 server. Check DNS after propagation; proxied website records normally return Cloudflare addresses, while the DNS-only tunnel record must resolve to your origin.
dig +short example.com A
dig +short check-dns.example.com A
dig +short tunnel.example.com A
dig +short tunnel.example.com AAAA
In Cloudflare choose SSL/TLS mode Full for the installer’s generated self-signed origin certificate and wait until the edge certificate covers your domain and wildcard. Full encrypts the edge-to-origin connection but does not validate the origin certificate. For origin authentication use Full (strict) with a valid Cloudflare Origin CA or publicly trusted certificate covering both example.com and *.example.com. A Cloudflare Origin CA certificate is for the proxied origin; browsers do not trust it when accessing the origin directly.
If you use DNS-only website records instead of Cloudflare proxying, install a publicly trusted certificate yourself. ProxVN does not run an automatic ACME issuance workflow. The default self-signed HTTPS certificate will otherwise trigger a browser trust error; do not treat bypassing that warning as a finished production setup.
There are two certificate pairs: wildcard.crt/key for browser HTTPS on 443, and server.crt/key for the client’s connection to the server on 8882. A control certificate pin is the public hash the client compares to the server certificate so it can recognize the expected server. Get that hash through a trusted channel; it is safe to share, while the matching private key must stay secret. Renewing the website certificate is separate from changing this client-server identity. The glossary explains these terms together.
3. Install the systemd server
VPS: download and inspect the installer, then execute it with explicit domain and source flags. The upstream source below is intentional even when reading this page on a self-hosted copy.
curl -fsSLo install-server.sh https://proxvn.io.vn/install-server.sh
less install-server.sh
sudo bash install-server.sh \
--domain example.com \
--public-host tunnel.example.com \
--ports 10000-20000 \
--source https://proxvn.io.vn
The installer stages the server, website archive and client binaries, verifies their SHA-256 entries from the HTTPS source, then installs them. Hashes detect transfer/file mismatches; trust still depends on the download source. It creates the proxvn service user, private configuration and persistent state, generates initial credentials and a JWT secret, writes the hardened systemd unit, and starts the service.
| Option | Effect |
|---|---|
--domain example.com | Required on first install; site and HTTP tunnel base domain. |
--public-host tunnel.example.com | Hostname advertised to clients and TCP/UDP visitors; defaults to tunnel.DOMAIN. |
--ports 10000-20000 | Inclusive public allocation range, between 1024 and 65535. |
--no-tune | Skip kernel/sysctl and journald tuning. The systemd limits are still installed. |
--no-swap | Do not create a swap file; separate from --no-tune. |
--no-nginx | Do not create the optional nginx HTTP bridge. |
--no-clients | Skip client downloads; the website’s download links then need binaries provisioned separately. |
--from-dir /path/to/bundle | Use a trusted local bundle containing executable proxvn-server, frontend/ and optionally bin/. No downloads from --source in this mode. |
By default, the script writes network settings under /etc/sysctl.d/90-proxvn.conf, selects BBR when available (otherwise cubic), raises queues/buffers/file limits, adjusts the ephemeral-port range if it overlaps your public range, and limits journald disk use. If there is no active swap and no /swapfile, it attempts to create 512–2048 MiB swap. On a shared machine inspect these host-wide changes first; use the skip flags if you manage tuning yourself.
The unit sets MemoryMax to 40% of host RAM with a 512 MiB minimum, MemoryHigh to 85% of that and GOMEMLIMIT to 75% of MemoryMax, plus LimitNOFILE=1048576. These are resource policies, not a promise that the workload cannot run out of memory.
/etc/proxvn/proxvn.env is kept, so changing --domain or --ports is not a configuration migration. Edit the saved file and restart. Do not pre-create a partial environment file, or assume HTTP_DOMAIN=... curl ... | sudo bash configures the service; that variable belongs to the curl process and the installer generates its own file.4. Open the correct firewall ports
| Port / protocol | Purpose and exposure |
|---|---|
443/tcp | Public HTTPS website, Console and HTTP tunnels. The installer needs this port free. |
80/tcp | Plain HTTP front door, when enabled. An existing nginx can bridge only the selected domain to loopback port 8880. |
8882/tcp | Public TLS control and TCP/HTTP data connections from clients; DNS-only hostname. |
8882/udp | Public UDP control/data transport used by UDP clients. |
10000–20000/tcp10000–20000/udp | Default public tunnel allocation range. Open only the range you actually configure and exclude ports belonging to other services. |
127.0.0.1:8881/tcp | Private API, dashboard, health and metrics. Keep the loopback bind; Console is already reachable through HTTPS 443. |
127.0.0.1:8880/tcp | Optional local HTTP bridge when another service already owns port 80. Do not expose it publicly. |
Apply equivalent allow rules in both the VPS provider’s security group/firewall and the host firewall. Keep your real SSH port allowed and keep the current session open. Do not reset or blindly enable a firewall on a remote host. If UFW is already your active firewall, inspect it first and add only the rules your selected listeners need:
sudo ufw status verbose
sudo ufw allow 443/tcp
sudo ufw allow 80/tcp
sudo ufw allow 8882/tcp
sudo ufw allow 8882/udp
sudo ufw allow 10000:20000/tcp
sudo ufw allow 10000:20000/udp
# only with a dedicated SSH gateway port (SSH_GATEWAY_PORT=2222):
sudo ufw allow 2222/tcp
The installer detects already-bound ports inside the selected public range on first configuration and saves them in PORT_EXCLUDE. The running allocator checks busy ports again. Explicitly exclude ports that another service may need later, for example PORT_EXCLUDE=18787,25000-25100. Busy-port avoidance does not make ports 443 or 8882 shareable.
DDoS protection has limits. Application request/session limits can reduce some abuse, but cannot stop a distributed attack that saturates the VPS network connection. DDoS means many sources overwhelming a service. Filtering from a CDN such as Cloudflare applies to traffic actually proxied through it: here, the proxied website and HTTP(S) tunnels. Direct TCP/UDP tunnels and client-control connections need network-level mitigation from the VPS provider or upstream network. Discuss that coverage with your provider. Keep required SSH and client-control access reachable, and test changes before tightening limits or firewall rules.
5. Verify startup, HTTPS and administrator access
VPS:
sudo systemctl is-active proxvn
sudo systemctl status proxvn --no-pager
curl --fail --show-error http://127.0.0.1:8881/health
sudo journalctl -u proxvn -n 80 --no-pager
sudo ss -lntup | grep -E ':(80|443|8880|8881|8882)\b'
curl --fail --show-error --head https://example.com/
curl --fail --show-error --head https://example.com/console/
Expect an active service and health JSON with status: ok and the installed version. The public HTTPS checks must succeed without -k when the edge/public certificate is ready. A loopback health success alone does not prove DNS, firewall, wildcard routing or browser trust works.
Open https://example.com/console/. Read the bootstrap credentials only in your private SSH terminal:
sudo cat /var/lib/proxvn/admin-password.txtSign in and change the password in the account settings. This file records the initial password and is not updated after a password change. Setting ADMIN_PASSWORD later is not a password-reset mechanism: admin seeding happens only when the database has no users. Never post the file, the environment, tokens or screenshots containing credentials in a support ticket.
6. Connect a local client to your server and verify the pin
Recommended: clients fetch the certificate pin from your website
When https://example.com has a publicly trusted certificate (Cloudflare proxy as set up above, or your own certificate), nothing has to be distributed. A 9.x client given --server tunnel.example.com:8882 without --cert-pin asks https://tunnel.example.com and then https://example.com for /api/public/connection over verified HTTPS and uses the published pins, but only when the published tunnel address is exactly the server you typed. Rotating server.crt or moving DNS to a new VPS then needs no new client download and no pin edits on users’ computers. If the website cannot be reached, the client falls back to the certificate it last trusted.
proxvn --server tunnel.example.com:8882 http 3000
If your tunnel hostname is not tunnel. + your website domain, or if you want clients to follow a change of tunnel hostname too, give the discovery URL instead; the client then takes both the address and the pins from the website:
proxvn --discovery-url https://example.com/api/public/connection http 3000
To avoid repeating it, add "discovery_url": "https://example.com/api/public/connection" to ~/.proxvn/config.json (without server or cert_pin), or set PROXVN_DISCOVERY_URL. The values come from Console → Connection settings, which also shows this URL. To migrate: publish the new server’s pin as next pin, move DNS or change the tunnel host, check that clients reconnect, then promote the new pin and clear the old one. A client that meets an unknown certificate reloads discovery once before failing, and never falls back to trusting it.
Use the manual pin below only when the website is not publicly trusted (for example a DNS-only site with the self-signed default), or for an offline/private setup.
Fallback: distribute the pin manually
VPS: calculate the control certificate’s SHA-256 over its DER bytes and send only this public hash to your users through a trusted channel:
sudo openssl x509 -in /var/lib/proxvn/server.crt -outform DER \
| sha256sum | awk '{print $1}'
The result is 64 hexadecimal characters without colons. It is the hash of server.crt, not the website certificate. Back up both server.crt and its private key; unexpectedly replacing them changes the identity clients remember.
Local computer: install a 9.x client from the official HTTPS download source, then paste the hash you verified. All examples below use a shell variable named PIN; its value is public, not a password.
curl -fsSLo install-proxvn.sh https://proxvn.io.vn/install.sh
PROXVN_BASE=https://proxvn.io.vn sh install-proxvn.sh
PIN=PASTE_THE_VERIFIED_64_HEX_CHARACTER_HASH
proxvn version
proxvn --server tunnel.example.com:8882 --insecure=false --token= --cert-pin "$PIN" http 3000
proxvn --server tunnel.example.com:8882 --insecure=false --token= --cert-pin "$PIN" tcp 22
proxvn --server tunnel.example.com:8882 --insecure=false --token= --cert-pin "$PIN" udp 19132
Run one tunnel per terminal and ensure the target service is already listening on that local port. These guest examples explicitly use --token= so an unrelated saved/environment token is not sent to the new server, and --insecure=false so an old insecure: true configuration cannot bypass the pin. On Windows PowerShell use $pin = "..." and proxvn --server tunnel.example.com:8882 --insecure=false --token= --cert-pin $pin http 3000. For a step-by-step local app test and other platforms, see the client tutorial and CLI reference.
Without an explicit pin, a new self-hosted server is trusted on first use and stored by host:port in ~/.proxvn/known_servers.json. That does not independently authenticate the first connection. Do not solve a certificate-change warning with --insecure; verify an intended rotation with the operator, then update the explicit/configured pin or only the affected remembered host entry.
Use an account on this server
Create/sign in to an account on https://example.com/console/, copy that account’s API key from Account, then save it locally. The login subcommand only writes a token; it does not contact or select a server. Do not append --server to login. Keep selecting your self-hosted server on tunnel commands, and do not reuse the official server’s account key here.
proxvn login YOUR_OWN_SERVER_API_KEY
proxvn --server tunnel.example.com:8882 --insecure=false --cert-pin "$PIN" http 3000 --subdomain myapp
The authenticated command intentionally omits --token= so it can use your own server’s saved API key. Check for an inherited PROXVN_TOKEN or a token in a selected/local JSON configuration: either can shadow the user configuration updated by login. Clear an unrelated environment token or select the correct server-specific configuration before connecting. See client configuration precedence.
Reserve the name in your own Console if you need lasting ownership. To avoid repeating flags, merge server and cert_pin into your existing ~/.proxvn/config.json with an editor, preserving its token and other settings; do not overwrite that file with a sample. For several servers use separate --config /path/to/own-server.json files with the correct token per server.
{
"server": "tunnel.example.com:8882",
"cert_pin": "PASTE_THE_VERIFIED_64_HEX_CHARACTER_HASH",
"insecure": false,
"token": "YOUR_OWN_SERVER_API_KEY",
"lang": "en"
}
7. Files, configuration and HTTPS certificate replacement
| Path | Content |
|---|---|
/opt/proxvn/proxvn-server | Installed executable. |
/opt/proxvn/frontend/ | Generated website, docs and Console. |
/opt/proxvn/bin/ | Download binaries; verify these match your server major version. |
/etc/proxvn/proxvn.env | Service configuration, including secrets; root:proxvn, mode 0640. |
/var/lib/proxvn/ | Database, SQLite sidecars if present, control/HTTPS keys, initial credentials, optional generated jwt.secret and backups/. |
/etc/systemd/system/proxvn.service | Service unit, executable arguments, sandbox and resource limits. |
sudoedit /etc/proxvn/proxvn.env
sudo systemctl restart proxvn
sudo systemctl is-active proxvn
curl --fail --show-error http://127.0.0.1:8881/health
The following are the relevant non-secret entries, not a replacement for your whole environment file. Keep the existing JWT secret and admin/SMTP values. Keep an existing nginx bridge value HTTP_PLAIN_ADDR=127.0.0.1:8880 instead of blindly copying :80. Use absolute paths; systemd EnvironmentFile is not a shell script and does not expand $HOME or another variable in a value.
HTTP_DOMAIN=example.com
SITE_DOMAIN=example.com
PUBLIC_HOST=tunnel.example.com
TUNNEL_HOST=tunnel.example.com
HTTP_PORT=443
HTTP_PLAIN_ADDR=:80
DASHBOARD_BIND=127.0.0.1
PUBLIC_PORT_START=10000
PUBLIC_PORT_END=20000
PORT_EXCLUDE=18787
DATA_DIR=/var/lib/proxvn
DB_PATH=/var/lib/proxvn/proxvn.db
FRONTEND_DIR=/opt/proxvn/frontend
BIN_DIR=/opt/proxvn/bin
AUTO_BACKUP=true
BACKUP_INTERVAL=24h
BACKUP_RETENTION_DAYS=7
SSH_ON_HTTPS=true
SSH_GATEWAY_PORT=0
SSH_ANONYMOUS=true
SSH tunnels without a client
With the SSH gateway, users publish an app with the ssh command already on their computer (user guide). SSH_ON_HTTPS=true accepts SSH on port 443 next to HTTPS, so no extra firewall rule is needed and users behind strict networks can connect. Users must connect to the DNS-only tunnel name, because a CDN proxy only forwards web traffic. New installations enable it; on an existing server, add these lines and restart:
# SSH tunnels: ssh -p 443 -R0:localhost:3000 tunnel.example.com
# Accept SSH on the HTTPS port (no extra firewall rule needed).
SSH_ON_HTTPS=true
# Optional dedicated port, e.g. 2222 (then also: ufw allow 2222/tcp). 0 = none.
SSH_GATEWAY_PORT=0
# false = an API key is required.
SSH_ANONYMOUS=true
SSH_ANON_TCP=true
# Limits for anonymous tunnels only.
SSH_ANON_TTL=60m
SSH_ANON_MAX_PER_IP=2
SSH_ANON_MAX_TOTAL=300
SSH_ANON_BANDWIDTH_KBPS=2048
SSH_ANON_QUOTA_MB=1024
# Safety page for browser visitors of anonymous tunnels.
SSH_ANON_WARNING=true
Anonymous tunnels run under the strict limits above, use random names only and show browser visitors a warning page; API-key tunnels have no such limits. Only -R forwards are accepted (no shell, command execution, sftp or other -L targets), and repeated invalid API keys block the source IP for 30 minutes. If abuse appears, set SSH_ANONYMOUS=false: account users keep working. The host key is created once in /var/lib/proxvn/ssh_host_ed25519_key; keep it in backups so users do not see a changed-key warning. Its fingerprint appears in Console → System and on the SSH page.
To install an already-issued HTTPS certificate covering both apex and wildcard, put its files on the VPS and copy them into the service’s readable state directory. Replace both source paths below. For a Cloudflare Origin CA certificate, create/download it for the two names in Cloudflare first, then switch to Full (strict) only after these files are active.
sudo install -o proxvn -g proxvn -m 0644 /path/to/fullchain.pem /var/lib/proxvn/wildcard.crt
sudo install -o proxvn -g proxvn -m 0600 /path/to/privkey.pem /var/lib/proxvn/wildcard.key
sudo systemctl restart proxvn
sudo journalctl -u proxvn -n 40 --no-pager
curl --fail --show-error --head https://example.com/
Alternatively set both HTTPS_CERT_FILE and HTTPS_KEY_FILE to readable absolute paths. The systemd sandbox cannot read files under your home directory. The HTTPS reloader checks certificate changes, but your renewal process must deliver a matching readable pair; verify the public result after every renewal. Leave TLS_CERT_FILE/TLS_KEY_FILE alone unless you intentionally rotate the separate control certificate.
8. Optional SMTP and account email
SMTP is off by default. Add your own relay settings to the private environment file; every value below is an example. Use the relay’s SMTP password or app password, not a website/API key unrelated to SMTP. Port 465 uses implicit TLS; other supported relay ports require STARTTLS.
SMTP_ENABLED=true
SMTP_HOST=smtp.example.net
SMTP_PORT=587
[email protected]
SMTP_PASSWORD=REPLACE_WITH_RELAY_PASSWORD
[email protected]
SMTP_FROM_NAME=ProxVN
SMTP_DAILY_LIMIT=450
sudo systemctl restart proxvn
sudo systemctl is-active proxvn
sudo journalctl -u proxvn -n 40 --no-pager
In Console → Website settings → Email & security, inspect the SMTP status and send one test to your own address. Successful SMTP acceptance is not proof of Inbox delivery: check Inbox/Spam. Enable mandatory verification only after the full link flow works; it is a separate saved policy and only becomes effective with SMTP enabled. Do not publish your filled environment file. The local daily limit is separate from provider quotas.
9. Consistent backup and restore
Automatic maintenance creates consistent SQLite database snapshots with VACUUM INTO under /var/lib/proxvn/backups/ every 24 hours by default, retaining seven days. Those files alone do not include your environment, JWT/control keys or website release. For an upgrade/rollback snapshot, stop the service and archive the complete state and matching application together. Never copy only a live proxvn.db while WAL writes may be pending.
VPS: this block restarts the service on exit, including when archiving fails. A stop briefly interrupts active tunnels.
backup_dir="/var/backups/proxvn/manual-$(date -u +%Y%m%dT%H%M%SZ)"
sudo install -d -m 0700 "$backup_dir"
(
set -eu
trap 'sudo systemctl start proxvn' EXIT
sudo systemctl stop proxvn
sudo tar -C / -czf "$backup_dir/proxvn-host.tar.gz" \
opt/proxvn etc/proxvn var/lib/proxvn \
etc/systemd/system/proxvn.service
sudo chmod 0600 "$backup_dir/proxvn-host.tar.gz"
sudo tar -tzf "$backup_dir/proxvn-host.tar.gz" >/dev/null
)
sudo systemctl is-active proxvn
sudo sha256sum "$backup_dir/proxvn-host.tar.gz"
Keep the printed archive path and hash, and copy the archive to a separate private/off-site backup location. It contains usable secrets; restrict access and encrypt it when storing elsewhere. Include any externally configured certificate/key paths and systemd overrides separately. Test recovery on another machine before you need it.
Restore the complete matching snapshot
For a systemd installation with the standard paths, set archive to the exact trusted backup. The fail-fast block checks that the archive exists, can be read completely and contains the required application/configuration/database/unit entries before stopping the service or moving anything. It creates a new private recovery directory and refuses to reuse an existing one. Current paths are moved aside instead of mixing old SQLite WAL/SHM files with a restored database. It restores the saved application, configuration and data together; do not use it for Docker. Schedule downtime and ensure enough disk space for both copies. If any later step fails, stop and inspect the error and preserved recovery directory; do not blindly rerun the block.
(
set -eu
archive=/var/backups/proxvn/manual-YYYYMMDDTHHMMSSZ/proxvn-host.tar.gz
sudo test -f "$archive"
sudo test -s "$archive"
sudo tar -tzf "$archive" >/dev/null
sudo tar -tzf "$archive" \
opt/proxvn/proxvn-server etc/proxvn/proxvn.env \
var/lib/proxvn/proxvn.db etc/systemd/system/proxvn.service
for current_path in /opt/proxvn /etc/proxvn /var/lib/proxvn \
/etc/systemd/system/proxvn.service; do
sudo test -e "$current_path"
done
rollback="/var/backups/proxvn/before-restore-$(date -u +%Y%m%dT%H%M%SZ)-$$"
sudo mkdir -m 0700 "$rollback"
sudo systemctl stop proxvn
sudo mv -T -- /opt/proxvn "$rollback/application"
sudo mv -T -- /etc/proxvn "$rollback/config"
sudo mv -T -- /var/lib/proxvn "$rollback/data"
sudo mv -T -- /etc/systemd/system/proxvn.service "$rollback/proxvn.service"
sudo tar -C / -xzf "$archive"
sudo systemctl daemon-reload
sudo systemctl start proxvn
curl --fail --show-error http://127.0.0.1:8881/health
)
If restoring only an automatic database snapshot instead, stop first, preserve the current whole data directory, then restore the snapshot to proxvn.db with owner proxvn:proxvn and mode 0600. Do not leave sidecars from a different database beside it. Preserve existing control certificates and JWT identity unless restoring those deliberately. Never run an older executable against a database already migrated by a newer schema.
10. Upgrade a 9.x deployment safely
- Take the complete stopped-service snapshot above. Check release notes and stage the change if this server carries important traffic.
- Keep the environment, database, control certificate/key and JWT secret. The installer preserves the existing environment/data and replaces the binary, frontend/download bundle and generated unit.
- Re-run the explicit official-source installer, then repeat health, HTTPS, account login and real HTTP/TCP/UDP checks from another network.
curl -fsSLo install-server.sh https://proxvn.io.vn/install-server.sh
sudo bash install-server.sh --source https://proxvn.io.vn
sudo systemctl is-active proxvn
curl --fail --show-error http://127.0.0.1:8881/health
sudo journalctl -u proxvn -n 80 --no-pager
For this security release, upgrade all HTTP/TCP/UDP clients and the server to matching 9.x releases. An 8.x or unversioned peer is rejected; 9.x minor/patch releases are compatible. Existing old Console sessions must sign in again. Database migration 7 rejects duplicate emails after trimming and case folding instead of merging accounts; resolve any reported conflict with the owners. Keep client/server clocks synchronized within 30 seconds for UDP authentication. Roll back with the matching application and pre-upgrade database snapshot together.
11. Docker Compose alternative on Linux
Use this instead of the systemd installer. Install Docker Engine and the Compose plugin for your Linux distribution first. The supplied Compose file uses network_mode: host: it needs the same free host ports and firewall rules as the native server. The container runs as UID/GID 1000 and needs a writable persistent ./data directory. The server image builds Go inside Docker, while a complete client-download set from build-all.sh additionally requires the Go version declared in src/backend/go.mod, Python 3, tar and sha256sum on the build machine.
VPS / Linux build host: use a fresh checkout, set your domains and public range in .env before starting. Leave ADMIN_PASSWORD empty to generate a private bootstrap password; never commit the filled file.
git clone https://github.com/hoangtuvungcao/proxvn_tunnel_full.git
cd proxvn_tunnel_full
cp .env.server.example .env
chmod 600 .env
nano .env
bash build-all.sh
mkdir -p bin
sudo install -d -o 1000 -g 1000 -m 0700 data
docker compose up -d --build proxvn-server
docker compose ps
docker compose logs --tail=80 proxvn-server
curl --fail --show-error http://127.0.0.1:8881/health
build-all.sh generates the bilingual website, server/client bundles and checksum manifests. If you skip it and only build the server image, packaged server/Console functionality can run, but the bind-mounted ./bin must be populated separately for client download links to work. Compose reads .env through env_file and explicitly overrides storage to DATA_DIR=/data, DB_PATH=/data/proxvn.db, website to /app/frontend and downloads to /app/bin. Do not substitute a different relative storage path.
docker compose exec proxvn-server cat /data/admin-password.txt
docker compose exec proxvn-server id
docker compose restart proxvn-server
docker compose logs -f proxvn-server
The bootstrap-password command is for a private terminal only. For an existing data/, inspect ownership before changing anything; do not blindly chown unrelated files or overwrite a valid database. After an environment change recreate the service with docker compose up -d --force-recreate proxvn-server; restart alone does not reload Compose’s changed container environment.
Docker backup and older storage migration
Stop the container and archive data/, private .env, Compose file and the exact release/image identity before recreating it. Keep SQLite WAL/SHM files with that stopped data directory. Older setups may have stored state inside /app/data rather than the bind mount: recover it from the stopped container before removal, verify its database/keys, and migrate into a separately backed-up host data/ with UID/GID 1000. Do not remove the old container until the recovered data is verified.
docker compose stop proxvn-server
# Only when inspection confirms the old state is inside /app/data:
docker cp proxvn-server:/app/data ./data-container-backup-UNIQUE_NAME
# After verifying/migrating the correct host data and preserving a backup:
docker compose up -d --build proxvn-server
For optional monitoring set a private GRAFANA_PASSWORD of at least 16 characters in .env, then run docker compose --profile monitoring up -d. Prometheus 9090 and Grafana 3000 bind to loopback. Reach them with an SSH tunnel, not public firewall rules:
ssh -L 3000:127.0.0.1:3000 -L 9090:127.0.0.1:9090 [email protected]
12. Troubleshoot by layer
| Symptom | Check and action |
|---|---|
| Installer stops on 443 | Run sudo ss -lntp 'sport = :443'; identify the owner and plan a dedicated listener/IP. Do not kill an unknown website process. |
| Service not active | Read journalctl -u proxvn -n 100, verify env syntax, state ownership and free 443/8882. Check systemctl show proxvn -p MemoryMax -p MemoryCurrent -p NRestarts for memory/restart evidence. |
| Health works; website fails | Check DNS, provider/host firewall, Cloudflare certificate mode and origin certificate. Test the real HTTPS hostname without disabling verification. |
| Client timeout | Check the DNS-only tunnel record, 8882/tcp, the selected --server, and the server listener. HTTP/TCP clients do not connect through the website’s proxied hostname. |
| Certificate changed | Stop and independently verify the control certificate pin. Restore the expected certificate/key from backup or coordinate an intended rotation; do not use --insecure. |
| Tunnel opens but HTTP returns 502 | On the client machine run curl http://127.0.0.1:3000, check app port/host and --host; opening a tunnel does not start your local app. |
| UDP has no traffic | Verify both peers are 9.x, 8882/udp and the assigned public UDP port are open, the local target speaks UDP, and clock skew is below 30 seconds. |
| No public ports available | Review allocations, PORT_EXCLUDE and busy listeners. Widen the configured range only after updating both firewalls and checking other services. |
For a guided fresh installation, follow the complete self-host tutorial. For the local side, continue with the client tutorial. Before asking for support collect version, sanitized logs, listener and DNS results; remove passwords, keys, email tokens and private links.