Keegan Turner
  • πŸ‘‹Hello World.
  • πŸ“šHow-To Guides
    • Integrating Git on your local host
    • βš–οΈLoad Balancing with HAProxy
    • πŸ‘¨β€πŸ’»Code Server - Self Hosted VSCode alternative
    • πŸ•ΈοΈWordPress + LAMP - Self Hosted CMS
    • ☁️Nextcloud - Self Hosted file sync & sharing solution
    • ⏳Grafana Cloud - Cloud Hosted Monitoring
    • βŒ›Prometheus + Grafana - Self Hosted monitoring stack solution
    • πŸ›³οΈPortainer + Docker - Self Hosted container management UI
    • 🐬MariaDB - Self Hosted database server
    • πŸ€–Let's Encrypt + Certbot - Secure your web services with SSL certificates
    • ◀️Nginx Proxy Manager - Self Hosted domain controller with LE SSL certificates
    • πŸ–₯️LXD - Linux OS containers
    • 🐧Linux basics: commands
    • 🐧Linux basics: file paths
    • 🐧Linux basics: SWAP file
  • 🚫Bytes of Caution
Powered by GitBook
On this page
  1. How-To Guides

Portainer + Docker - Self Hosted container management UI

2023-10-21

Docker is a containerization platform that allows you to package applications and their dependencies into lightweight, isolated containers. These containers can run consistently across different environments, making it easier to deploy and manage applications.

For this installation, I will be using Ubuntu as my distribution of choice. The below commands will work on any Debian-based distribution.

Step 1

Access your cloud instance via SSH and update the repositories.

sudo apt update -y
sudo apt upgrade -y

Step 2

Install Docker & Docker compose

sudo apt install docker.io docker-compose

Start and enable the Docker service by running:

sudo systemctl enable --now docker

Verify that Docker is running:

sudo systemctl status docker

Step 3

Install Portainer We will use Docker to deploy a container with the Portainer container management tool

Run the following command in the terminal:

sudo docker volume create portainer_data
sudo docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

This command creates a Docker volume named "portainer_data" and then starts the Portainer container, exposing ports 8000 and 9000 for web access. The container will be automatically restarted if it crashes or when the system reboots.

Check the status of the docker container created

sudo docker ps

Remember to open port 9000 on the instance firewall.

Once the container is running, you can access the Portainer web interface by opening a web browser and navigating to: http://yourserveripaddress:9000

Create your Portainer account

Welcome to the Portainer dashboard

You have successfully installed Docker and Portainer on Ubuntu. You can now use Portainer to manage your Docker environment.

NB - If you are managing Portainer access through NGINX proxy manager, remember to enable websockets Support in NGINX. This will allow container CLI access from within Portainer.

PreviousPrometheus + Grafana - Self Hosted monitoring stack solutionNextMariaDB - Self Hosted database server

Last updated 1 year ago

πŸ“š
πŸ›³οΈ
Page cover image