Traefik
Overview
Traefik Proxy is a cloud-native edge router for publishing your services. It receives requests on behalf of your system and routes them to the right backend using a rule engine (host, path, headers and more). It includes built-in load balancing, middlewares (auth, rate limiting, retries, redirects), automatic HTTPS through Let's Encrypt, and a live web dashboard.
The SecureAnyCloud image installs Traefik 3.7.5 as a dedicated systemd service that binds ports 80 and 443 directly. The dashboard is available at /dashboard/ behind HTTP basic authentication. ACME certificate storage and logs persist on a dedicated Azure data disk, and the image generates a unique dashboard password on the first boot of every VM. The image is backed by 24/7 SecureAnyCloud support.
What you get:
- Traefik Proxy 3.7.5 (a single static Go binary) at
/usr/local/bin/traefik web(:80),websecure(:443) and a loopbackping(127.0.0.1:8082) entrypoint- The built-in dashboard/API at
/dashboard/on:80, protected by a basicAuth middleware (api.insecureisfalse) - A preconfigured Let's Encrypt certificate resolver (HTTP challenge)
- A dedicated Azure data disk at
/var/lib/traefikfor ACME storage (acme.json) and logs, separate from the OS disk and re-provisioned with every VM - File-provider dynamic configuration in
/etc/traefik/dynamic/for your routers and services traefik.servicerunning as an unprivileged user with onlyCAP_NET_BIND_SERVICE- 24/7 SecureAnyCloud support
Prerequisites
Before you deploy, make sure you have an active Azure subscription, an SSH key pair, and a VNet and subnet in the target region. Standard_B2ms (2 vCPU, 8 GiB RAM) is a good starting size. Scale up for high request volumes. In the network security group (NSG), allow inbound 22/tcp from your management network, and 80/tcp and 443/tcp for the proxied traffic and the dashboard. To get real Let's Encrypt certificates, point a DNS name at the VM's public IP.
Step 1 - Deploy from the Azure Marketplace
Sign in to the Azure portal, choose Create a resource, search the Marketplace for Traefik Proxy by SecureAnyCloud, and select Create. On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22), HTTP (80) and HTTPS (443). Review the dedicated data disk on the Disks tab, then select Review + create and Create.
Step 2 - Deploy from the Azure CLI
Accept the Marketplace terms once per subscription, create the VM, and open ports 80 and 443. Replace the values in angle brackets:
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:traefik-ubuntu-24-04:default:latest
az vm create \
--resource-group <your-rg> \
--name traefik \
--image sac1647283583153:traefik-ubuntu-24-04:default:latest \
--size Standard_B2ms \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_ed25519.pub \
--vnet-name <your-vnet> --subnet <your-subnet> \
--public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name traefik --port 80 --priority 1010
az vm open-port --resource-group <your-rg> --name traefik --port 443 --priority 1020Step 3 - Connect to your VM
Connect over SSH as azureuser:
ssh azureuser@<vm-public-ip>Step 4 - Confirm the service is running
Check the service status:
systemctl is-active traefik.serviceThe command reports active. Traefik starts in under a second.
Step 5 - Retrieve your dashboard password
The first boot of your VM generates a unique dashboard password and writes it to a root-only file. Read the file:
sudo cat /root/traefik-credentials.txtThis file contains TRAEFIK_ADMIN_USER (admin) and TRAEFIK_ADMIN_PASSWORD, plus the dashboard URL. Store the password in a safe place.
Step 6 - Check the health endpoint
Traefik exposes an unauthenticated ping endpoint on a loopback entrypoint for health probes. Query it:
curl -s http://localhost:8082/pingThe endpoint returns OK.
Step 7 - Open the dashboard
Browse to http://<vm-public-ip>/dashboard/ and sign in as admin with the password from Step 5. The dashboard shows your entrypoints and the routers, services and middlewares that Traefik has loaded, with live health.
The HTTP Routers view lists every router and the rule that matches requests to it.
The HTTP Services view shows your backends and their load-balanced servers.
Step 8 - Confirm the API from the command line
The Traefik API is available behind the same basic authentication. Confirm that it is serving and reports its router and provider tree:
curl -s -u admin:<TRAEFIK_ADMIN_PASSWORD> http://localhost/api/overview | head -c 300; echoThe response is JSON that describes the http, tcp and udp routers, services and middlewares, plus enabled features and providers.
Step 9 - Define a router and service
Traefik watches /etc/traefik/dynamic/ for configuration. Add a YAML file there to route a host name to your backends, with TLS from the preconfigured Let's Encrypt resolver and load balancing across two servers:
# /etc/traefik/dynamic/my-app.yml http: routers: my-app: rule: "Host(`app.example.com`)" service: my-app entryPoints: ["websecure"] tls: certResolver: letsencrypt services: my-app: loadBalancer: servers: - url: "http://10.0.1.10:8080" - url: "http://10.0.1.11:8080"Traefik picks up the change immediately, with no restart, and the new router and service appear in the dashboard. You manage middlewares (auth, rate limiting, redirects, headers) the same way.
Step 10 - Confirm ACME storage lives on the dedicated disk
Issued certificates (acme.json) and the access and Traefik logs are stored on the dedicated Azure data disk, so they survive OS changes and you can resize the disk independently. Check the mount:
findmnt /var/lib/traefikThe mount is backed by a separate Azure data disk captured into the image and re-provisioned on every VM.
Enabling HTTPS
The image ships a letsencrypt certificate resolver preconfigured with the HTTP challenge. To get a real certificate, follow these steps. First, point a DNS name at the VM's public IP. Next, set your email in /etc/traefik/traefik.yml (the certificatesResolvers.letsencrypt.acme.email field) and run sudo systemctl restart traefik. Then attach tls.certResolver: letsencrypt to a router on the websecure entrypoint (as in Step 9). Traefik requests, installs and renews the certificate automatically and stores it in acme.json on the data disk.
Maintenance
- Routes: add or edit YAML files in
/etc/traefik/dynamic/. Traefik reloads them automatically. - Backups: snapshot the
/var/lib/traefikdata disk to back up issued certificates. - Upgrades: replace
/usr/local/bin/traefikwith a newer release, then runsudo systemctl restart traefik. - Security patches: unattended-upgrades stays enabled, so the OS keeps receiving security updates automatically.
Support
SecureAnyCloud provides 24/7 expert support for this image. Contact sales@secureanycloud.com.
Deploy on Azure
Launch Traefik Proxy on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
This image runs Traefik Proxy, the modern, cloud-native reverse proxy and load balancer for publishing services. Traefik discovers your services through the file, Docker, Kubernetes and other providers, routes traffic with expressive rule matchers, terminates TLS, and obtains certificates automatically from Let's Encrypt.
What you get:
- The Traefik static binary under
/usr/local/bin/traefik, running as a dedicated unprivilegedtraefiksystem account under a systemd service that starts it on boot and restarts it on failure. - Only the
CAP_NET_BIND_SERVICEcapability for the service, so it can bind the privileged ports 80 and 443 without running as root. - The static configuration, the dynamic configuration directory and the Let's Encrypt certificate store under
/etc/traefik, which is a dedicated, independently resizable EBS data volume. - A dashboard that is never exposed unprotected. The Traefik dashboard ships with no authentication by default, so a dynamic router publishes the dashboard and API on the web entrypoint (port 80) under the
/dashboardand/apipath prefixes, gated by an HTTP Basic authentication middleware. - A dashboard password generated on the first boot of every deployed instance, so two instances launched from the same Amazon Machine Image never share a password. The password is written to
/root/traefik-credentials.txtwith mode 0600, so only the root user can read it.
Prerequisites
Before you deploy this image, make sure you have the following:
- An Amazon Web Services account where you can launch EC2 instances
- IAM permissions to launch instances, create security groups, and subscribe to AWS Marketplace products
- An EC2 key pair in the target Region for SSH access to the instance
- A VPC and subnet in the target Region, with a security group allowing inbound port 22 from your management network, port 80 for the dashboard and the web entrypoint, and port 443 for the websecure entrypoint
- The AWS CLI (version 2) installed locally if you plan to deploy from the command line
Launch the Instance from the AWS Marketplace
Sign in to the AWS Management Console, open the EC2 service, and select Launch instance. Under Application and OS Images, choose AWS Marketplace AMIs and search for Traefik Proxy. Select the SecureAnyCloud listing, choose Select, then choose Continue on the subscription summary.
Pick an instance type of t3.medium or larger. Choose your EC2 key pair under Key pair (login). Under Network settings, select your VPC and subnet, and create or select a security group that opens port 22 from your management network, port 80 for the dashboard and web entrypoint, and port 443 for the websecure entrypoint. Leave the root volume at the default size or larger.
Select Launch instance. First-boot initialization takes a few seconds after the instance state becomes Running and the status checks pass.
Launch the Instance from the AWS CLI
The following command launches an instance from the SecureAnyCloud Traefik Proxy Marketplace AMI into an existing subnet and security group. Replace <ami-id> with the AMI ID shown on the Marketplace listing. Replace <key-name> with your EC2 key pair name and <subnet-id> with your subnet ID. Replace <security-group-id> with a security group that opens ports 22, 80 and 443 as described above.
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type t3.medium \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=traefik}]'When the instance reaches the Running state and its status checks pass, note its public IP address or DNS name. You can find it in the EC2 console or with aws ec2 describe-instances.
Connect to Your Instance
Connect over SSH using your key pair. The login user on the Ubuntu 24.04 variant is ubuntu:
ssh -i <key-name>.pem ubuntu@<public-ip>Retrieve the Dashboard Password
The dashboard password is unique to your instance and was generated on first boot. Read it as root:
sudo cat /root/traefik-credentials.txtThe file lists the dashboard URL, the dashboard user (admin) and the generated password, along with usage notes. Keep this password in a safe place.
Sign In to the Web Dashboard
The dashboard and API are served on port 80 under the /dashboard and /api path prefixes, behind an HTTP Basic authentication middleware. In a browser, go to:
http://<instance-public-ip>/dashboard/The browser prompts you for credentials. Sign in as admin with the password from the credentials file. The dashboard home shows your entrypoints (the web entrypoint on :80, the websecure entrypoint on :443, and the loopback traefik and ping entrypoints) and a live count of HTTP and TCP routers, services and middlewares.
Select HTTP Routers in the sidebar to list every configured router with its rule, entrypoints, service and priority. Out of the box, you see the router that publishes the dashboard and API, and the ACME and ping routers that Traefik provides by default.
Select HTTP Services to inspect the backend services, their load-balancer servers and their health status. Routers reference services by name, and a service is what actually load-balances across your backend servers.
Confirm Traefik Is Running
Over SSH, confirm that the service is active, the health endpoint answers, and the entrypoints are listening:
sudo systemctl is-active traefik curl -s http://127.0.0.1:8082/pingThe first command reports active and the ping endpoint returns OK. Confirm the binary version and that the entrypoints are bound:
traefik version
sudo ss -tlnp | grep -E ':(80|443|8080|8082) 'The output shows Traefik listening on :80 (the web entrypoint) and :443 (the websecure entrypoint). The dashboard entrypoint on 127.0.0.1:8080 and the ping entrypoint on 127.0.0.1:8082 are bound to loopback only.
The Configuration Layout
Traefik is configured in two parts. The static configuration at /etc/traefik/traefik.yml defines the entrypoints, providers, the API and dashboard, and the certificate resolvers. Traefik reads it once at startup. The dynamic configuration is in /etc/traefik/dynamic/ and is watched by the file provider, so adding, editing or removing routers, services and middlewares there takes effect without a service restart.
sudo ls -la /etc/traefik/dynamic/The listing includes dashboard.yml, which publishes the dashboard and API behind the HTTP Basic authentication middleware. Add your own YAML files alongside it to publish your backends.
Publish a Backend Service
To route traffic to one of your backends, create a router and a service in a new file under the watched dynamic configuration directory. The following example, saved as /etc/traefik/dynamic/my-app.yml, routes requests whose Host header is app.example.com on the web entrypoint to a backend at 10.0.0.10:8080:
http: routers: my-app: rule: "Host(`app.example.com`)" entryPoints: - web service: my-app services: my-app: loadBalancer: servers: - url: "http://10.0.0.10:8080"Save the file, and Traefik reloads it within a second. Refresh the HTTP Routers and HTTP Services views in the dashboard, and your new router and service appear. Define weighted load balancing, health checks, sticky sessions, rate limiting, headers, redirects and circuit breakers the same way. See the Traefik routing documentation for the full set of options.
Query the API
The Traefik API is published alongside the dashboard on port 80 under /api, behind the same HTTP Basic authentication. From outside the instance, send requests to http://<instance-public-ip>/api/... with basic authentication user admin and the generated password. For example, fetch the routers overview:
curl -s -u admin:<password> http://<instance-public-ip>/api/http/routersThe /api/overview endpoint returns the counts shown on the dashboard home, and /api/http/routers, /api/http/services and /api/http/middlewares return the full live configuration as JSON.
The Data Volume
The static configuration, the dynamic configuration directory and the Let's Encrypt certificate store all live on a dedicated EBS volume mounted at /etc/traefik. This keeps your routing configuration and certificates off the operating system disk and lets you resize or snapshot them independently. Confirm the mount:
df -h /etc/traefikTo grow the volume, expand the EBS volume in the AWS console, then grow the file system on the instance by running sudo resize2fs on the underlying device. Because the dynamic configuration and the ACME store live here, your routers and issued certificates survive replacing the instance.
Enable Automatic HTTPS with Let's Encrypt
A Let's Encrypt certificate resolver named letsencrypt is preconfigured in the static configuration using the ACME HTTP-01 challenge, with its store at /etc/traefik/acme.json. It stays inactive until you attach it to a router with a real domain. To enable HTTPS for a backend, point a DNS A record at the instance's public IP, then add a router on the websecure entrypoint with TLS and the resolver, for example in /etc/traefik/dynamic/my-app.yml:
http: routers: my-app-secure: rule: "Host(`app.example.com`)" entryPoints: - websecure service: my-app tls: certResolver: letsencryptBefore you request certificates for real domains, set the resolver email in /etc/traefik/traefik.yml to your own address. On the first request for the domain, Traefik obtains and stores the certificate automatically and renews it before expiry. Restrict the security group so that only the networks that need to reach your services can connect to ports 80 and 443.
Backup and Maintenance
To back up your configuration and certificates, snapshot the /etc/traefik EBS volume. The snapshot captures the static configuration, the dynamic configuration directory and the ACME store. Apply operating system security updates with sudo apt-get update && sudo apt-get upgrade, and reboot when a new kernel is installed. Traefik starts automatically on boot. To upgrade Traefik itself, replace the binary at /usr/local/bin/traefik with a newer release and restart the service with sudo systemctl restart traefik.
Support
This image is published and supported by SecureAnyCloud. Support covers deployment, router and middleware configuration, provider setup, automatic TLS and Let's Encrypt, load balancing strategies, and edge hardening. To reach SecureAnyCloud, use the support channel listed on the AWS Marketplace listing.
All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Deploy on AWS
Launch Traefik Proxy on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com