Skip to content

Tunnels-Only Servers

A tunnels-only server accepts no inbound traffic from the internet. Its firewall denies every incoming connection: no SSH and no web traffic. You reach its services with reoclo tunnel. The desktop app and tailnet shares use the same tunnels.

Everything Reoclo does for the server keeps working, because the runner opens the connection to Reoclo itself. Deploys, exec, browser terminals and logs all travel over that outbound connection, and so does every tunnel.

Use it for servers that only your team should reach, such as a database host or a box that runs internal tools.

  • A server connected with the runner. SSH-connected servers cannot be tunnels only.
  • A runner version that supports the setting. The dashboard tells you when the runner needs an upgrade.
  • ufw installed on the server. Reoclo uses it as the host firewall.
  • The runner’s sudo rules from a current install, so it can run ufw and manage Docker’s firewall guard. A server installed with an older setup command needs the runner reinstalled to pick them up.
  1. In the dashboard, open Servers, click Add Server and choose Set up a new server. In the setup step, turn on Tunnels only. The extra open ports field disappears, because a tunnels-only server opens none.
  2. Run the generated command on the server. It carries --tunnels-only, and the server shows as tunnels only once the runner connects.

When you run setup.sh yourself, pass the flag directly:

Terminal window
curl -fsSL https://get.reoclo.com/setup | sudo bash -s -- \
--env production --token <TOKEN> --yes --harden --tunnels-only

--tunnels-only turns on the firewall step with default deny incoming and no allow rules. fail2ban is skipped, because nothing is public. With --harden, SSH still accepts keys only and root cannot log in. You cannot combine --tunnels-only with --firewall-allow or --no-runner: the first contradicts it, and without a runner there would be no way to reach the server.

Setup closes the firewall last. Your current SSH session stays open until you leave it, and new connections need a tunnel.

  1. Open the server page, find the Network access card, choose Tunnels only and confirm.
  2. Reoclo applies the change through the runner. The card shows Applying, then Enforced once the firewall is closed.

If something stops the switch, the confirmation dialog lists each blocker. They are the same things a tunnels-only server refuses to accept, described under What Reoclo refuses. Remove them first, then switch.

Before closing the firewall, the runner removes the inbound allow rules and saves them. Choosing Public again restores the rules Reoclo saved. A server that was tunnels only from setup has nothing saved, so switching it to public opens the SSH port or ports sshd listens on, plus 80 and 443, the same set setup.sh --harden opens.

Forward a port from the server to your machine:

Terminal window
reoclo tunnel reoclo-production -L 5432:5432
psql -h 127.0.0.1 -p 5432 -U app appdb

The Network access card lists the services listening on the server, with the matching reoclo tunnel command for each.

SSH works the same way, through a tunnel to port 22:

Terminal window
reoclo tunnel reoclo-production -L 2222:22
ssh -p 2222 <user>@127.0.0.1

Run the SSH command in a second terminal while the tunnel stays open. The reoclo tunnel reference covers saved tunnels, reverse tunnels, local HTTPS and the Tailscale transport.

A public domain needs public traffic, so Reoclo refuses these on a tunnels-only server:

  • Adding a custom domain to an application on the server.
  • Enabling the managed Caddy proxy on the server.
  • Creating a preview environment on the server.
  • Choosing the server as a preview server.

Each attempt returns a 409 with this message:

This server accepts no inbound traffic, so it cannot serve a public domain. Reach its services with reoclo tunnel, or switch the server to public.

Reoclo publishes container ports on 127.0.0.1 when it deploys to a tunnels-only server. A container started with -p 8080:80 by Reoclo listens as 127.0.0.1:8080, and Compose stacks deployed by Reoclo get the same loopback binding. Tunnels reach loopback ports, so they keep working.

Docker has its own firewall behavior on top of that. On rootful Docker, a published port is redirected before ufw sees the traffic, so ufw alone would not block it. The runner keeps a guard rule in Docker’s firewall chain that drops new connections from outside, and puts it back after a reboot or a Docker restart. Rootless Docker publishes ordinary host sockets, which ufw already filters, so it needs no guard.

The guard covers IPv4. A container port published on IPv6 is reported as drift instead of being blocked.

Reoclo checks a tunnels-only server in two ways. It reads the firewall state the runner reports, and it probes the address the runner connects from, looking for any port that answers. A drifted server shows up in the server warnings, and the Network access card says what opened and when the firewall was last read.

ReasonWhat it means
Firewall inactiveufw is off.
Incoming allowedThe default policy for incoming traffic is allow.
Allow ruleSomeone added an inbound allow rule. The card shows it.
Docker guard missingDocker is rootful and the guard rule is not in place.
Public port openThe outside probe found a port that answers.

Click Re-apply to close it again. Reoclo never removes a rule on its own, so a rule you added by hand stays until you run Re-apply or delete it yourself. The outside probe skips servers whose connecting address is not a public one, and says so on the card.