How to Install Portainer in Docker on Rocky Linux
Step 1: Install Docker on Rocky Linux
Before using Portainer, ensure you have Docker installed. If not, follow these steps:
- Update your package manager's cache:
- Install required dependencies:
- Add the Docker repository and install Docker:
- Start and enable the Docker service:
- Verify Docker installation:
sudo dnf update
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo systemctl enable docker
sudo docker --version
Step 2: Install Portainer
Deploy Portainer as a Docker container:
- Pull the Portainer Docker image:
- Create a Docker volume for Portainer data persistence:
- Start the Portainer container:
sudo docker pull portainer/portainer-ce
sudo docker volume create portainer_data
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:
- Open your web browser and navigate to:
http://your_server_ip:9000
Replace your_server_ip
with your Rocky Linux server's IP address.
Step 4: Set Up Portainer
Complete Portainer's setup:
- Choose a password for the admin user.
- Specify a Portainer agent endpoint (leave as default for local Docker).
- Click "Connect."
- Create an admin user account (username and password).
- Click "Create user."
- 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 Rocky Linux and can now use it to manage Docker resources through its web-based interface.