Deploy Docker, Docker-Compose, Portainer and NPM (Nginx Proxy Supervisor) – InfoSec Memo

On this tutorial, you’ll study to put in and configure Docker, Docker-compose, the Portainer container administration resolution on a Linux server and use it to create and handle Docker containers to run completely different apps. Additionally, you will study to place these containers behind Nginx utilizing the Nginx proxy supervisor.The Nginx proxy supervisor (NPM) is a reverse proxy administration system working on Docker. NPM relies on an Nginx server and offers customers with a clear, environment friendly, and exquisite internet interface for simpler administration.

Set up Docker & Docker-Compose

Ubuntu System:

apt set up -y && apt set up docker-compose

CentOS System:

Set up Docker on CentOS 8:

curl -sSL | sh 
systemctl begin docker 
systemctl allow docker
Set up Docker Compose on CentOS 8:

Necessary: Examine the most recent model of docker-compose from then modify following command with newest model quantity. (I bought 1.29.2 for this set up)

curl -L "$(uname -s)-$(uname -m)" -o /usr/native/bin/docker-compose
chmod +x /usr/native/bin/docker-compose
ln -s /usr/native/bin/docker-compose /usr/bin/docker-compose

Set up Portainer

Instructions to put in Portainer:

[[email protected] ~]# docker quantity create portainer_data
[[email protected] ~]# docker run -d -p 9000:9000 --name portainer --restart at all times -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/information portainer/portainer-ce:newest

Entry Portainer:

  • Be certain that your VPS’s 9000 port has been opened. 

Confirm Portainer from Web by visiting http://<VPS’s Public IP>:9000

  1. Set up Docker and Docker-Compose
  1. Create a docker-compose.yml file just like this:
  1. Carry up your stack by working
  1. Log in to the Admin UI

When your docker container is working, connect with it on port 81 for the admin interface. Typically this may take a little bit bit due to the entropy of keys.

Default Admin Person:

Instantly after logging in with this default person you may be requested to switch your particulars and alter your password

Log in and alter password.

Entry NPM

1 Open the URL https://<yourserverIP>:81 in your browser, and you’re going to get the next display screen. Enter the next default credentials to check in.

Electronic mail deal with: [email protected] Password: changeme

2 Subsequent, you may be instantly requested to set a reputation and an electronic mail deal with. Click on the Save button, and you may be requested to create a brand new password. Click on the Save button once more to get began.

3 Go to the Hosts >> Proxy Hosts and click on the Add Proxy Host button.

4 Enter the area title as Select the scheme as https. Enter the title of the container because the Ahead Hostname and 9443 because the Ahead port. Examine the choices Block Widespread Exploits and Websockets Assist choices.

Configure NPM for Portainer

Configure NPM for NPM


Leave a Reply

Your email address will not be published.