Install Docker & Docker-Compose
Ubuntu System:
apt install docker.io -y && apt install docker-compose
CentOS System:
curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker
curl -L "https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Enable IPv6 and Limit Log File Size
ÂChange some Docker's default configuration:
Add customized self defined IPv6 address segment to enable container's IPv6 fucntion. And limit log file's size and numbers in case log file to fill all hard drive's space.Â
cat > /etc/docker/daemon.json << EOF
{
"log-driver": "json-file",
"log-opts": {
"max-size": "20m",
"max-file": "3"
},
"ipv6": true,
"fixed-cidr-v6": "fd00:dead:beef:c0::/80",
"experimental":true,
"ip6tables":true
}
EOF
Restart Docker service:
systemctl restart docker
Install Portainer
Commands to install Portainer:
[root@arm1 ~]# docker volume create portainer_data
portainer_data
[root@arm1 ~]# docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
- Make sure your VPS's 9000 port has been opened in your security group.Â
Install NPM
Method 1 - Portainer
Method 2 - Docker-Compose YML file
- Install Docker and Docker-Compose
- Create a docker-compose.yml file similar to this:
version: '3'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
- Bring up your stack by running
docker-compose up -d
- Log in to the Admin UI
When your docker container is running, connect to it on port 81
 for the admin interface. Sometimes this can take a little bit because of the entropy of keys. You might want to open Port 81 from your cloud firewall / access-list.Â
http://<Public IP>:81
Default Admin User:
Email: [email protected]
Password: changeme
Immediately after logging in with this default user you will be asked to modify your details and change your password
Access NPM
1Â Open the URLÂ https://<YourServerPublicIP>:81
 in your browser, and you will get the following screen. Enter the following default credentials to sign in.
Email address:Â [email protected]
 Password: changeme
2 Next, you will be immediately asked to set a name and an email address. Click the Save button, and you will be asked to create a new password. Click the Save button again to get started.
3 Visit the Hosts >> Proxy Hosts and click the Add Proxy Host button.
4 Enter the domain name as portainer.example.com
. Choose the scheme as https
. Enter the name of the container as the Forward Hostname and 9443 as the Forward port. Check the options Block Common Exploits and Websockets Support options.
No comments:
Post a Comment