This repository contains a Docker Compose configuration for running Portainer CE (Community Edition), a lightweight management UI for Docker environments.
Portainer is a web-based Docker management interface that allows you to easily manage your Docker containers, images, networks, and volumes through an intuitive web UI.
- Docker Engine installed on your system
- Docker Compose installed on your system
-
Clone this repository:
git clone <repository-url> cd portainer
-
Start Portainer:
docker-compose up -d
-
Access Portainer in your web browser:
http://localhost:9000 -
On first access, you'll be prompted to create an admin user account.
The docker-compose.yml file includes the following configuration:
- Image:
portainer/portainer-ce:latest- The latest Portainer Community Edition - Port:
9000- Web interface accessible on port 9000 - Volumes:
/var/run/docker.sock:/var/run/docker.sock- Allows Portainer to communicate with Dockerportainer_data:/data- Persistent storage for Portainer data
- Restart Policy:
always- Automatically restarts the container if it stops
docker-compose up -ddocker-compose downdocker-compose logs portainerdocker-compose pull
docker-compose up -d- Change the default port (9000) if needed for security reasons
- Consider setting up SSL/TLS for production environments
- Restrict access to the Portainer interface using firewalls or reverse proxies
- Regularly update to the latest version for security patches
If port 9000 is already in use, modify the port mapping in docker-compose.yml:
ports:
- "8080:9000" # Change 9000 to any available portEnsure the Docker socket has proper permissions:
sudo chmod 666 /var/run/docker.sockPortainer data is stored in a Docker volume named portainer_data. This ensures that your settings, users, and configurations persist across container restarts.
To backup Portainer data:
docker run --rm -v portainer_data:/data -v $(pwd):/backup alpine tar czf /backup/portainer-backup.tar.gz -C /data .To restore Portainer data:
docker run --rm -v portainer_data:/data -v $(pwd):/backup alpine tar xzf /backup/portainer-backup.tar.gz -C /dataFeel free to submit issues and enhancement requests!
This project is provided as-is. Portainer itself is licensed under the zlib License.