Host Traefik on VeloxaHost
Traefik is a reverse proxy and load balancer that builds its routes from providers such as Docker labels or configuration files, and can get Let's Encrypt certificates by itself. Developers run it in front of several apps on one server so each gets its own host name or path without hand-written proxy rules.
The one-click install downloads Traefik v3.7.15, the latest release of the supported 3.7 line at this page's check, from Traefik's GitHub releases to /usr/local/bin/traefik, and runs it as the traefik systemd service under its own traefik user. That user gets one extra capability, binding ports below 1024, so Traefik can listen on port 80 without running as root.
The service starts Traefik with:
- a
webentry point on port 80, on every address, for your apps; - the file provider, reading route files from
/etc/traefik/dynamicand reloading them when they change; - the API and dashboard, routed to Traefik's internal
api@internalservice on an entry point bound to127.0.0.1:8080, so it is reachable only from the server itself.
No routes for your apps and no certificate resolver are set up yet: those depend on your apps and domain.
The dashboard
Traefik's docs warn that its API "will expose all configuration elements, including sensitive data", so the install keeps it off the network. To see it, use an SSH tunnel on the first port of your block, which already forwards to SSH:
ssh -N -L 8080:127.0.0.1:8080 -p 20000 root@203.0.113.10
Then open http://localhost:8080/dashboard/ (the trailing slash matters). The route that serves it is /etc/traefik/dynamic/dashboard.yml.
Adding routes
Each YAML file in /etc/traefik/dynamic adds routers and services, and Traefik picks up changes without a restart. This one sends a host name to an app on port 3000:
http:
routers:
app:
entryPoints:
- web
rule: Host(`app.example.com`)
service: app
services:
app:
loadBalancer:
servers:
- url: http://127.0.0.1:3000
Docker labels are the other common provider: install Docker on the server, add --providers.docker=true to the service's ExecStart (systemctl edit --full traefik), give the traefik user access to Docker's socket, and label each container with its rule.
Reaching it on VeloxaHost
Every server gets a block of ports (10 by default) on the region's shared IPv4 address. The first forwards to SSH; under How to connect on the server's page, forward another to port 80 (the web entry point) and open http://<shared address>:<port>.
Adding Let's Encrypt
The install leaves certificates out because Traefik's ACME resolver needs an email address and Let's Encrypt must reach the server on port 80 (HTTP challenge) or 443 (TLS challenge). Shared IPv4 cannot offer those ports, so first get a dedicated IPv4 address (a paid add-on with limited availability) and point your domain at it. Then:
- Make a writable place for certificates:
install -d -o traefik -g traefik /var/lib/traefik. - Run
systemctl edit --full traefikand add these flags toExecStart:--entrypoints.websecure.address=:443 --certificatesresolvers.le.acme.email=you@example.com --certificatesresolvers.le.acme.storage=/var/lib/traefik/acme.json --certificatesresolvers.le.acme.httpchallenge.entrypoint=web - In your router, use the
websecureentry point and addtls: { certResolver: le }, thensystemctl restart traefik.
IPv6 is not available in US East yet.
What it needs
Traefik is a single Go binary and light on memory; its docs set no hardware figures. The catalogue's minimum is 1 vCPU and 256 MB, and 512 MB is plenty for a proxy in front of a few apps. That fits the Veloxa Nano size: 1 vCPU, 1 GB RAM and 25 GB of disk for $4 a month, billed at $0.01 an hour and capped at the monthly price.
Backups and updates
Traefik's state is its configuration: the unit file /etc/systemd/system/traefik.service, your route files in /etc/traefik/dynamic and, once you add a resolver, /var/lib/traefik/acme.json. Turn on automatic snapshots on the server page (hourly up to weekly, kept for 1 to 30 days) or scheduled backups (every 6 hours up to weekly, keeping 1 to 10).
Each new minor release ends active support for the previous one, so check Traefik's release support page from time to time. To update, take a snapshot, then download the new release over the binary and restart:
curl -fsSL https://github.com/traefik/traefik/releases/download/v<version>/traefik_v<version>_linux_amd64.tar.gz -o /tmp/traefik.tgz
tar -xzf /tmp/traefik.tgz -C /usr/local/bin traefik
systemctl restart traefik
FAQ
Is the dashboard exposed to the internet?
No. It listens on the server's loopback address only, on port 8080. Reach it through an SSH tunnel, as above; forwarding a port to 8080 does not reach it.
Does it get HTTPS certificates by itself?
Traefik can, with a certificate resolver, but the one-click install does not configure one, because it needs your email address and a dedicated IPv4 address for ports 80 and 443. The steps above add it.
Does Traefik run as root?
No. It runs as the traefik user, with one extra capability: binding ports below 1024, such as 80 and 443.
Traefik or Nginx?
Traefik builds routes from Docker labels or files and reloads them on its own, which suits many containers on one server. Nginx keeps routes in hand-written server blocks and is a familiar choice for a few static sites and apps.
What license is Traefik under?
Traefik is released under the MIT License.
Which VeloxaHost size fits Traefik?
The recommended 1 vCPU and 512 MB of RAM fits a Veloxa Nano: 1 vCPU, 1 GB RAM and 25 GB of disk for $4 a month, billed at $0.01 an hour and capped at that price.