- Traefik is a modern, open-source reverse proxy and load balancer designed specifically for microservices and containerized environments.
- It acts as the entry point for your web applications, routing incoming HTTP and TCP requests to the appropriate backend services.
In this tutorial, we will show you how to Install Traefik in ubuntu 24.
Download and install Traefik
wget https://github.com/traefik/traefik/releases/download/v3.5.0/traefik_v3.5.0_linux_amd64.tar.gz -O traefik.tar.gz
tar -xvzf traefik.tar.gz
sudo mv traefik /usr/local/bin/
Check traefik version
traefik version
Create Directory Structure
sudo mkdir -p /etc/traefik/acme
sudo touch /etc/traefik/traefik.yml
sudo touch /etc/traefik/dynamic.yml
Configure traefik.yml
vim /etc/traefik/traefik.yml
entryPoints:
web:
address: ":80"
websecure:
address: ":443"
api:
dashboard: true
log:
level: DEBUG
providers:
file:
filename: /etc/traefik/dynamic.yml
Configure Route to a Blog Backend
vim /etc/traefik/dynamic.yml
http:
routers:
blog-router:
rule: "Host(`localhost`)"
service: test-service
entryPoints:
- web
services:
test-service:
loadBalancer:
servers:
- url: "http://127.0.0.1:8081"
Create index.html file
mkdir ~/myblog
echo "<h1>Welcome</h1>" > ~/test/index.html
cd ~/myblog
python3 -m http.server 8081
Now your blog will be served on http://localhost:8081 and accessible through Traefik at http://localhost/
Conclusion
Traefik is a powerful and flexible reverse proxy that simplifies routing and load balancing in modern, dynamic environments. With its automatic service discovery, seamless SSL management, and user-friendly dashboard, Traefik helps developers and operators efficiently manage traffic to microservices and containerized applications.
If you encounter any challenges while trying to install Traefik in Ubuntu 24 or need expert assistance with configuration and performance tuning, it’s always best to consult professionals. At Skynats, our server management services are designed to help businesses seamlessly deploy, secure, and manage their infrastructure. Get in touch with us today for 24/7 support and streamlined DevOps solutions tailored to your needs.