Install PORTAINER using DOCKER in UBUNTU

How to Install Portainer using Docker on Ubuntu

Step 1: Install Docker on Ubuntu

Before using Portainer, ensure you have Docker installed. If not, follow these steps:

  1. Update your package manager's cache:
  2. sudo apt update
  3. Install required dependencies:
  4. sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
  5. Add Docker's official GPG key:
  6. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  7. Add the Docker repository:
  8. echo "deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  9. Update the package index:
  10. sudo apt update
  11. Install Docker:
  12. sudo apt install -y docker-ce docker-ce-cli containerd.io
  13. Start and enable the Docker service:
  14. sudo systemctl start docker
    sudo systemctl enable docker
  15. Verify Docker installation:
  16. sudo docker --version

Step 2: Install Portainer

Deploy Portainer as a Docker container:

  1. Pull the Portainer Docker image:
  2. sudo docker pull portainer/portainer-ce
  3. Create a Docker volume for Portainer data persistence:
  4. sudo docker volume create portainer_data
  5. Start the Portainer container:
  6. sudo 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

Step 3: Access Portainer

Access Portainer's web interface:

  1. Open your web browser and navigate to:
  2. http://your_server_ip:9000

    Replace your_server_ip with the IP address of your Ubuntu server.

Step 4: Set Up Portainer

Complete Portainer's setup:

  1. Choose a password for the admin user.
  2. Specify a Portainer agent endpoint (leave as default for local Docker).
  3. Click "Connect."
  4. Create an admin user account (username and password).
  5. Click "Create user."
  6. You'll be redirected to the Portainer dashboard to manage Docker resources.

That's it! You've successfully installed Portainer in a Docker container on Ubuntu and can now use it to manage your Docker resources through its web-based interface.

Related Articles