Skip to content

Traefik on a VPS

Reverse proxy for containers

Category
Dev / Tools
Author
Traefik Labs
License
MIT
Version
3.7.13

The script is free · VPS from $2.79 per month · installs in about 45 seconds

Install over SSH

root@vps:~# command -v docker >/dev/null || curl -fsSL https://get.docker.com | sh; docker run -d --name traefik --restart unless-stopped -p 80:80 -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock traefik:v3.7 --api.insecure=true --providers.docker

  • SystemUbuntu 24.04 · x86_64ok
  • Sourcegithub.com/traefik/traefikok
  • Version3.7.13ok
  • Port80/tcplisten
  • Port8080/tcplisten

✓ Traefik 3.7.13 installed · about 45 seconds

root@vps:~#

Install command from the library. Output is shortened and may differ on your server.

What it is

  • Reverse proxy
  • Docker
  • Let's Encrypt

Traefik is a reverse proxy that discovers Docker containers on its own and builds routes from their labels. Start a service with the right label and it's instantly reachable at its domain.

Great when a server runs many containers: no need to edit the proxy config for every new service, and Traefik issues Let's Encrypt certificates itself.

The command runs Traefik from the official image in quick-start mode with an open dashboard for testing.

  • Docker service auto-discovery via labels
  • Let's Encrypt with auto-renewal
  • Load balancing and middlewares (auth, rate limits)
  • Routes dashboard
  • Prometheus metrics

Recommended plan

For Traefik: at least 1 vCPU, 2 GB RAM and 10 GB NVMe.

Minimum to run
1 vCPU · 1 GB RAM · 10 GB disk
Systems
Ubuntu 22.04 · Ubuntu 24.04 · Debian 12

How to install

Three steps in the bot or one command over SSH; installation takes about 45 seconds.

  1. 01

    Choose a plan in the bot

    Open @ExpressHost_bot and pay for a VPS. The server will be ready in about 60 seconds.

  2. 02

    Add Traefik

    At the “Add-ons” step pick the script from the library, or run it later: Server settings → Scripts.

  3. 03

    Open the dashboard at http://server-IP:8080

    The bot will send the server address and login details to the chat.

Manually over SSH

Connect to the server as root and run the command. Supported systems: Ubuntu 22.04, Ubuntu 24.04, Debian 12.

Install command
command -v docker >/dev/null || curl -fsSL https://get.docker.com | sh; docker run -d --name traefik --restart unless-stopped -p 80:80 -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock traefik:v3.7 --api.insecure=true --providers.docker

Ports

Traefik ports
PortProtocolPurpose
80tcpIncoming HTTP
8080tcpDashboard and API (`--api.insecure` mode, testing only)

After installation

  1. 1.Open the dashboard at http://server-IP:8080
  2. 2.Start a service with a label: docker run -d --label 'traefik.http.routers.app.rule=Host(`app.example.com`)' traefik/whoami
  3. 3.For production, disable --api.insecure, add a 443 entrypoint and a Let's Encrypt certresolver

Traefik FAQ

Didn’t find an answer? Message @ExpressHost_SupportBot.

Can I leave the dashboard open?

No, --api.insecure is for testing only. In production, close port 8080 or protect the dashboard with authentication.

How do I update Traefik?

Run docker pull traefik:v3.7, remove the container and start it with the same command.

Why choose Traefik over Nginx?

It picks up new containers automatically. Nginx has to be reconfigured by hand for every service.

Traefik installs at checkout — in the bot.