Byte Ebi's Logo

Byte Ebi 🍀

A Bit everyday A Byte every week

Portainer - A Visual Docker Management Tool

Introducing how to use Portainer for visualizing and managing Docker services

Ray

Local development mostly involves command-line operations or using Docker’s GUI interface for service management.
Portainer is an open-source UI tool that allows viewing Docker images and containers, and executing actions such as start, stop, restart, and remove. It also enables viewing logs and errors for each container.
Even individuals without Docker execution permissions can log in using credentials when deploying services on cloud-hosted servers, utilizing the visual interface for various Docker service management tasks.

Dockerhub image: portainer/portainer-ce

docker-compose.yml

version: '3'

services:
  portainer:
    image: portainer/portainer-ce
    command: -H unix:///var/run/docker.sock
    restart: always
    ports:
      - 9000:9000
      - 8000:8000
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data

volumes:
  portainer_data:

Opening port 8000 for the edge agent: Documentation


Note

If you don’t want to expose ports on a remote host to allow any user to access the backend interface, you can use a more discreet connection method: How to Create SSH Tunneling or Port Forwarding in Linux

ssh -i ~/.ssh/id_rsa -L 8081:localhost:9000 ray@{your_remote_host_IP}

After starting the container, you can execute this command in the local terminal.
Then, you can access port 9000 on the remote host via port 8081 on your localhost.
This method utilizes SSH connections to forward requests from port 8081 on the local machine to port 9000 on the remote host.

This approach works regardless of whether the remote firewall has opened the specified port and is not limited to Portainer services.

Recent Posts

Categories

Tags