Use LocalXpose with Traefik

This tutorial will go through using LocalXpose to access Traefik from the internet and therefore accessing multiple local services using one tunnel.

Traefik

Traefik is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy. Traefik integrates with your existing infrastructure components (Docker, Swarm mode, Kubernetes, Marathon, Consul, Etcd, Rancher, Amazon ECS, ...) and configures itself automatically and dynamically. (Read more)

Architecture

For this tutorial, we will create a small lab that has three services, our blogging platform Ghost, file hosting service NextCloud and a demo website using Nginx demo container.

In front of these three services we will run Traefik which will mange the routing between these services and lastly will create LocalXpose container to access Traefik from the internet.

Prerequisites

Step 1 - Reserve wildcard custom domain

We will use a custom wildcard domain, for this example we will use this custom domain example.com, so we need to reserve it:

Then we should add a CNAME record in our DNS provider, You can read more about domain reservations here.

Step 2 - Prepare docker-compose stack file

Change the following *.example.com with your actual reserved domain and replace the access token with yours.

Step 3 - Start our stack file

Step 4 - Access these services from the internet

Now you can access these services from the internet like https://nginx.example.com, https://blog.example.com and https://nextcloud.example.com.

Last updated

Was this helpful?