Self-hosting: when the internet does not reach your server
The installer stopped at the direct-route check: how to see why, what fixes it and what you should see after, at a cloud or at home.
Look first
Until the installer registers the workspace, <slug>.perly.ai points at perly's own servers, never at yours. Never test the name: test your public address and send the name by hand.
Port 80 at the public address, as perly tests it:
curl -sI --resolve <slug>.perly.ai:80:<public IP> http://<slug>.perly.ai/Port 443 at the public address (the TLS must reach your server untouched):
openssl s_client -connect <public IP>:443 -servername <slug>.perly.ai </dev/nullBehind a proxy, perly's own ports, where the proxy sends perly's name (8880 for port 80, 8443 for 443): at 127.0.0.1 for a proxy on this machine, at this machine's LAN address for one on another machine:
curl -sI --resolve <slug>.perly.ai:8880:<127.0.0.1 or LAN IP> http://<slug>.perly.ai:8880/
openssl s_client -connect <127.0.0.1 or LAN IP>:8443 -servername <slug>.perly.ai </dev/nullWhat this machine has, read-only. Without sudo yourself, give these to the person at the machine to run and paste back:
ip -4 addr
ip -4 route get 1.1.1.1
sudo ss -ltnp '( sport = :80 or sport = :443 or sport = :8880 or sport = :8443 )'
sudo nft list ruleset 2>/dev/null | head -n 80; sudo iptables -S 2>/dev/null | head -n 60
sudo ufw status verbose 2>/dev/null; sudo firewall-cmd --list-all 2>/dev/null
sudo docker ps -a --format "{{.Names}} {{.Status}} {{.Ports}}"
ls -la /etc/perly /srv/perly 2>/dev/null; sudo cat /etc/perly/proxy-lines.conf 2>/dev/null
sudo tail -n 50 /var/log/perly-get.log 2>/dev/null; sudo perly-server status 2>/dev/null
sudo nginx -T 2>/dev/null | grep -nE "listen|server_name|default_server|return 30|ssl_preread|proxy_pass|stream"Behind a proxy, while the installer waits at its question (Enter, T or Q), it answers on 8880 and 8443 itself, where perly will listen, and says so on the terminal: HTTP with the header Server: perly-installer, TLS with a certificate named perly installer stand-in (no TLS without openssl). So the tests above show the way through end to end before perly is installed. Once you type Q, nothing answers there until you run the installer again. With no proxy, perly takes 80 and 443 itself, and nothing answers there until it is installed.
On any server
The workspace's name points at perly until the server registers
<slug>.perly.ai is a name perly answers for on its own servers until the installer registers this one; only then does it point at your public address.
How to see it
perly's onboarding page has not ticked Registered with perly yet. Anything sent to the name now reaches perly's servers and shows perly's certificate, whatever this machine does, so it says nothing about this machine.
What fixes it
Nothing to fix: test the public address with --resolve and -servername, as in Look first. The installer points the name at your address when it registers.
What you should see after
Once the installer has registered the workspace, getent hosts <slug>.perly.ai prints your public address.
On any server
Another web server holds 80 and 443
nginx, Apache, Caddy, Traefik or a hosting panel already answers on 80 and 443, on this machine or on the one at the public address.
How to see it
What holds the ports here, and what answers at the public address:
sudo ss -ltnp '( sport = :80 or sport = :443 )'
curl -sI --resolve <slug>.perly.ai:80:<public IP> http://<slug>.perly.ai/ | grep -i '^server'What fixes it
nginx, HAProxy and Traefik: add the lines the installer wrote (/etc/perly/proxy-lines.conf, and on perly's onboarding page), reload the proxy, then press Enter at the installer. Apache cannot pass the TLS through untouched, nor Caddy without its layer4 plugin: forward 80 and 443 to this machine instead, or use perly's tunnel.
What you should see after
curl -sI with --resolve at the public address shows Server: perly-installer while the installer waits, and the installer goes on through the proxy by itself.
On any server
Your proxy runs in Docker (nginx-proxy-manager, Traefik in a container)
A proxy in a container has a 127.0.0.1 of its own: lines that send perly's name to 127.0.0.1:8880 and :8443 reach the container itself, never this machine, so a test from the machine passes while the proxy still drops the connection.
How to see it
What holds 80 and 443 is docker-proxy, or a container publishes them:
sudo ss -ltnp '( sport = :80 or sport = :443 )'
sudo docker ps --format '{{.Names}} {{.Image}} {{.Ports}}'From inside the proxy's container, perly's ports at the address its lines name (the stand-in answers there while the installer waits):
sudo docker exec <proxy container> curl -sI http://<LAN IP>:8880/
sudo docker exec <proxy container> curl -sI http://host.docker.internal:8880/What fixes it
Send perly's name to this machine's LAN address in place of 127.0.0.1 (8880 for port 80, 8443 for 443, the TLS passed through untouched), or to host.docker.internal after adding it to the proxy's container (Docker Compose: extra_hosts: ["host.docker.internal:host-gateway"]), then recreate the container. Let the proxy's network reach those two ports in this machine's firewall (see firewalld, ufw or nftables on this machine). Traefik passes the TLS through with a tcp router, HostSNI and passthrough: true; nginx-proxy-manager's Streams forward a whole port, not one name, so with other sites on its 443, forward the ports to this machine instead or use perly's tunnel.
What you should see after
The docker exec curl from inside the proxy's container answers with Server: perly-installer while the installer waits, and the tests in Look first answer at the public address.
On any server
nginx's default server or a redirect takes the name first
Port 80 for the workspace's name answers with a redirect to https (301 or 308), or with another site: a server block listening on 80 with default_server, or a catch-all return 301 https://…, gets the name before perly's block.
How to see it
At the public address, port 80 answers with a Location to https instead of reaching this machine:
curl -sI --resolve <slug>.perly.ai:80:<public IP> http://<slug>.perly.ai/Which server blocks listen on 80, and which has default_server or a catch-all redirect (on the proxy's machine):
sudo nginx -T | grep -nE "listen .*80|server_name|default_server|return 30"What fixes it
Keep perly's block (server_name <slug>.perly.ai; listen 80;) in a file nginx reads (conf.d/perly.conf is included from http { } on Debian, Ubuntu and RHEL; sites-enabled only on Debian and Ubuntu), and make sure no other block on 80 names it or a wildcard over it. A catch-all redirect (server_name _ or default_server with return 301) stays: an exact server_name wins over default_server. Then:
sudo nginx -t && sudo systemctl reload nginxWhat you should see after
The curl at the public address answers 200 with Server: perly-installer while the installer waits, not a 301.
On any server
443 needs the stream block, 80 the http block
perly ends its own TLS: 443 must pass through nginx untouched (a stream { } block with ssl_preread, at the top level), while 80 is an ordinary server { } inside http { }. A 443 server { } with ssl in http { } decrypts it and breaks perly's certificate.
How to see it
The TLS at 443 shows your own certificate, or none, instead of the stand-in:
openssl s_client -connect <public IP>:443 -servername <slug>.perly.ai </dev/null 2>/dev/null | grep -E "subject|issuer"nginx's config has no stream block, or no stream module:
sudo nginx -T | grep -nE "stream|ssl_preread|listen .*443"; nginx -V 2>&1 | grep -o with-streamWhat fixes it
Install the stream module (Debian and Ubuntu: libnginx-mod-stream; RHEL: nginx-mod-stream), put the stream { } block from /etc/perly/proxy-lines.conf at the top level of nginx.conf, move your own sites from listen 443 ssl to listen 127.0.0.1:4443 ssl as the lines say, then nginx -t and reload.
Under SELinux enforcing (Fedora, RHEL, Rocky, Alma), nginx listens only on ports labelled http_port_t: see whether 4443 is, and label it if not (-m in place of -a when another type already holds it):
sudo semanage port -l | grep -w http_port_t
sudo semanage port -a -t http_port_t -p tcp 4443What you should see after
openssl s_client at the public address shows subject CN = perly installer stand-in while the installer waits (and, once installed, a Let’s Encrypt certificate for the name).
On any server
Nothing answers on 8443 and 8880 yet
"Server started: Stopped" on perly's onboarding page means the installer stopped at its direct-route check, before it installed Docker, downloaded perly or registered: perly itself cannot start before then (its programs come after registration, and its certificate needs the name pointed at you). A proxy that already sends the name on to 8443 and 8880 finds nothing there, and drops the connection.
How to see it
Nothing listens on 8880 and 8443, and the proxy answers 502 or drops the TLS:
sudo ss -ltnp '( sport = :8880 or sport = :8443 )'What fixes it
Run the same install command again and leave it at its question (Enter, T or Q): while it waits, it answers on 8880 and 8443 itself. Test through the proxy then, and press Enter once the tests in Look first answer.
What you should see after
ss shows python3 on 8880 and 8443 while the installer waits; after Enter, the installer goes on, and perly listens there in its place.
On any server
firewalld, ufw or nftables on this machine
The machine's own firewall drops 80 and 443, or 8880 and 8443 from the proxy's machine.
How to see it
The firewall's rules, whichever this machine runs:
sudo ufw status verbose; sudo firewall-cmd --list-all; sudo nft list ruleset | head -n 80What fixes it
Allow the ports perly needs: 80 and 443 when the internet reaches this machine directly; 8880 and 8443 from the proxy's machine when one sends the name on. For example:
sudo ufw allow 80,443/tcp
sudo ufw allow from <proxy IP> to any port 8880,8443 proto tcp
sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="<proxy IP>" port port="8880" protocol="tcp" accept'
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="<proxy IP>" port port="8443" protocol="tcp" accept'
sudo firewall-cmd --reloadWhat you should see after
From the proxy's machine, curl -sI http://<LAN IP>:8880/ answers with Server: perly-installer while the installer waits.
On any server
Docker's iptables rules (DOCKER-USER)
Docker writes its own iptables chains: a rule in DOCKER-USER, or a firewall that resets Docker's chains, can drop traffic to perly's containers although the host firewall allows it.
How to see it
Docker's chains and what DOCKER-USER drops:
sudo iptables -S DOCKER-USER; sudo iptables -S FORWARD | head -n 20What fixes it
Remove the DROP or REJECT rule in DOCKER-USER for 80 and 443 (or 8880 and 8443), or add an ACCEPT above it. After a firewall reload that wiped Docker's chains, restarting Docker writes them again, but it restarts every container on this machine: ask the person first.
sudo systemctl restart dockerWhat you should see after
sudo iptables -S DOCKER-USER lists no DROP or REJECT for the ports perly needs, and the tests in Look first answer.
On any server
SELinux stops nginx connecting onward
On Fedora, RHEL, Rocky and Alma, SELinux keeps nginx from opening connections to another address or port: the proxy answers 502 and its log says Permission denied.
How to see it
SELinux is enforcing, nginx's log says Permission denied on its onward connection, and perly's ports are not labelled for it:
getenforce
sudo tail -n 20 /var/log/nginx/error.log | grep -i "permission denied"
sudo semanage port -l | grep -w http_port_t; getsebool httpd_can_network_connectWhat fixes it
The narrow way first: nginx may connect to ports labelled http_port_t, so label perly's. See which of 8880 and 8443 already are (on Fedora and RHEL the default list holds 8443; the command shows this machine's), and label each one missing (-m in place of -a when another type already holds it):
sudo semanage port -l | grep -w http_port_t
sudo semanage port -a -t http_port_t -p tcp 8880
# only when the list above lacks 8443:
sudo semanage port -a -t http_port_t -p tcp 8443Only when that is not enough: let nginx connect to any port (wider; it stays on after a reboot):
sudo setsebool -P httpd_can_network_connect 1What you should see after
semanage port -l lists 8880 and 8443 under http_port_t (or getsebool httpd_can_network_connect says on), and the tests in Look first answer through the proxy.
On any server
Old containers or an earlier perly install hold the ports
A container from an earlier install, or another service, holds 80, 443, 8880 or 8443, running or restarting.
How to see it
Every container, stopped ones too, with its ports, and what holds the ports:
sudo docker ps -a --format '{{.Names}} {{.Status}} {{.Ports}}'
sudo ss -ltnp '( sport = :80 or sport = :443 or sport = :8880 or sport = :8443 )'
ls -la /srv/perly /etc/perlyWhat fixes it
Stop what holds the ports, after asking whoever runs it (never delete a container or volume you did not make). An earlier perly install comes back by running the installer with its --data-dir; sudo perly-server uninstall removes one for good.
What you should see after
ss shows the ports free, or held by perly.
On any server
The machine sleeps
A laptop's lid, idleness or a desktop's suspend turns the machine off: perly stops answering, and a test made while it sleeps times out.
How to see it
Whether this machine turns itself off:
sudo sh /usr/local/lib/perly/install.sh awake checkWhat fixes it
Keep it awake (two systemd settings, removed by an uninstall); ask the person first:
sudo sh /usr/local/lib/perly/install.sh awake fixWhat you should see after
The check prints awake.
A server at a cloud
A security group or cloud firewall closes 80 and 443
The cloud's own firewall (an AWS security group, a GCP or Azure network rule) drops 80 and 443 before they reach the server.
How to see it
From another network, port 80 times out, while on the server something listens:
curl -sI --max-time 10 --resolve <slug>.perly.ai:80:<public IP> http://<slug>.perly.ai/
sudo ss -ltn '( sport = :80 or sport = :443 )'The instance's security group or firewall rules in the cloud's console list no inbound 80 and 443.
What fixes it
Allow inbound TCP 80 and 443 from anywhere (0.0.0.0/0) in the instance's security group or network firewall, in the cloud's console.
What you should see after
From another network, the curl above answers within a second; press Enter at the installer to check again.
A server at a cloud
No public IPv4 address (IPv6 only)
perly reaches a server directly over IPv4: a server with only IPv6, or only a private address, has no address to point the name at.
How to see it
This machine's addresses: no public IPv4 among them, and the address it reaches the internet from is not its own:
ip -4 addr; curl -4s https://ifconfig.meWhat fixes it
Give the server a public IPv4 address at the cloud (most charge a little for one), then run the installer again with --address <that address>. Or use perly's tunnel, which needs none.
What you should see after
curl -4s https://ifconfig.me prints the address you gave it.
A server at a cloud
An elastic IP that is not attached
The address given with --address is reserved at the cloud but not attached to this instance, so it answers for nothing.
How to see it
The cloud's console lists the address with no instance, or another one; on the server, the address it goes out from differs:
curl -4s https://ifconfig.meWhat fixes it
Attach the elastic or reserved IP to this instance in the cloud's console, then press Enter at the installer.
What you should see after
curl -4s https://ifconfig.me prints the elastic IP.
A server at a cloud
The provider's own firewall (Hetzner, OVH, Lightsail)
Some providers filter in front of the server, apart from the machine's own firewall: Hetzner's Cloud Firewall, OVH's Network Firewall, Lightsail's per-instance Networking rules.
How to see it
From another network, 80 and 443 time out although the server's own firewall lets them in. The provider's panel lists a firewall attached to the server.
What fixes it
Add inbound rules for TCP 80 and 443 in the provider's panel (Hetzner: Firewalls; OVH: Network Firewall on the IP; Lightsail: the instance's Networking tab, IPv4 firewall).
What you should see after
From another network, curl to port 80 at the public address answers; press Enter at the installer.
A machine at home or in an office
Behind a router with no port forward
At home or in an office the public address is the router's: without a port forward, 80 and 443 stop there.
How to see it
This machine has a private address (10.x, 172.16–31.x, 192.168.x), and from another network port 80 at the public address times out or shows the router:
ip -4 route get 1.1.1.1What fixes it
In the router's admin page, forward TCP 80 and 443 to this machine's LAN address (or to the machine whose proxy passes perly's name on). Give this machine a fixed LAN address (a DHCP reservation) so the forward stays right.
What you should see after
From a phone off Wi-Fi, http://<public IP>/ answers with this machine (or its proxy), not the router's page; press Enter at the installer.
A machine at home or in an office
Carrier-grade NAT
The internet provider shares one public address among many customers: the router's own internet (WAN) address is not the public one, and no port forward gets past the provider.
How to see it
The router's status page shows a WAN address from 100.64.x.x to 100.127.x.x, a private one (10.x, 172.16–31.x, 192.168.x: another router in front of yours, double NAT, whose port forward is needed too), or one that differs from:
curl -4s https://ifconfig.meWhat fixes it
Ask the provider for a public IPv4 address of your own (often a small fee), or use perly's tunnel, which works behind carrier-grade NAT.
What you should see after
The router's WAN address and curl -4s https://ifconfig.me print the same address.
A machine at home or in an office
The internet provider blocks 80 and 443
Some home connections block inbound 80 and 443 at the provider, whatever the router forwards.
How to see it
The forward is in place and the router's own firewall allows it, yet from another network 80 and 443 time out. The provider's terms or support say whether it blocks servers on home lines.
What fixes it
Ask the provider to open them (a business line usually has them open), or use perly's tunnel, which needs no inbound port.
What you should see after
From another network, curl to port 80 at the public address answers.
A machine at home or in an office
A virtual machine behind its host (libvirt, virbr0)
A VM on libvirt's default network (virbr0, 192.168.122.x) sits behind its host: the router forwards to the host, and the host does not pass 80 and 443 on to the VM.
How to see it
In the VM, the address is 192.168.122.x (or another host-only range); on the host, virbr0 holds the other end:
ip -4 addr # in the VM
ip -4 addr show virbr0 # on the hostWhat fixes it
Either give the VM a bridged network (it takes an address on the LAN, and the router forwards to it), or let the host's proxy pass perly's name on to the VM's 8880 and 8443 with the lines the installer wrote (see 443 needs the stream block, 80 the http block).
What you should see after
From the host, curl to the VM's 8880 answers while the installer waits; from outside, the tests in Look first answer with Server: perly-installer.
A machine at home or in an office
Testing the public address from inside the network
Many routers do not loop their own public address back to the LAN (hairpin NAT): a test from inside times out although the internet reaches the server.
How to see it
The curl at the public address times out from this machine, but answers from a phone off Wi-Fi or a check site.
What fixes it
Test from outside the network (a phone's mobile data, another server). perly's own test runs from the internet, so hairpin NAT never stops the installer.
What you should see after
From outside, the tests in Look first answer.
On any server
Use perly's tunnel instead
perly's tunnel needs no public address and nothing opened or forwarded: the server dials out to perly's relay, which passes the TLS through untouched (perly never decrypts it).
How to see it
Any case above that you cannot fix (carrier-grade NAT, a provider that blocks 80 and 443, a router you cannot reach).
What fixes it
Type T at the installer's question, or run the same install command again without --reach direct.
What you should see after
perly's onboarding page moves on to Registered with perly, and the workspace opens at its address.