
βοΈNginx Proxy Manager - Self Hosted domain controller with LE SSL certificates
2024-05-14
Nginx proxy is a powerful tool used to manage and route web traffic efficiently. By acting as a middleman between clients and servers, it enables tasks like load balancing, caching, and enhancing security.
Step 1
Prepare your environment.
My stack is as follows:
Cloudflare for DNS management
xneelo Cloud for my Ubuntu server
Docker & Portainer for containerization
Connect to your Linux server or instance via SSH and update the system
sudo apt update -y && sudo apt upgrade -y
Once the system updates have completed, install Docker & Docker compose
sudo apt install docker.io docker-compose
Create and change directory into a new folder for the docker compose files
sudo mkdir nginx
cd nginx/
Create the docker compose file and add the NGINX container configuration
sudo nano docker-compose.yaml
add the code and save the file
version: '3.8'
services:
app:
image: 'docker.io/jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
Run the docker compose command in the same directory:
sudo docker-compose up -d
The container will start to create from the YAML file.
Ensure that port 81 is open for access on your network firewall. You can access the Nginx proxy manager by entering http://yourserverip:81. At this stage, I already have my domain name set to point to the server IP in Cloudflare where I manage my DNS.
Upon first login, use the following credentials:
Email: [email protected]
Password: changeme
Under proxy hosts, you can add the subdomains with the server IP and port number. When a request to access the added URL is received, the proxy will send the request to the respective port on your network.
Last updated