Docker is the next form in the evolution beyond virtualization. A Docker image contains “everything” in it needed to run an application in a self contained environment. This makes it lightweight, self sufficient and portable to be run either on-premise or on the cloud. The Docker API provides multiple options to interface with images and containers. Managing many images and containers will become time-consuming without using a good UI for Docker.
Portainer is a simple, lightweight Docker management toolset that provides an easier way to manage Docker environments (hosts or swarms clusters).
Simplicity is the key to run Portainer. This guide will provide the simplest way to get started by deploying Portainer server on a standalone Linux or Windows host or single node swarm cluster.
1. Installing the Portainer server
Setup on Linux and Windows* environment :
$ docker volume create portainer_data
$ 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
Note :
- The first command will create a volume outside the scope of any container.
- The second command runs the container at port 9000 with a restart always flag to allow restarting the container if it stops.
- These commands will install the Server. Agents are not necessarily needed for standalone hosts.
You can manipulate, start and stop Portainer with the name specified during the launch, in this case portainer
$ docker stop portainer
$ docker start portainer
2. Dashboard Access
The command now starts the server at port 9000. You can access the admin page via http://localhost:9000 . You will be prompted to setup the admin account to sign into the portal.
Choose the appropriate environment you want Portainer to manage and click connect.
Once connected, the Home page for the chosen environment details will be presented.
You can explore various options under Settings section to add users and groups to manage this server setup, change Registries, use Extensions etc.
Choosing the Endpoint will launch its full dashboard.
3. Downloading images and creating containers
To get started to creating images and containers , navigate to Containers and choose an image of your choice to pull. If you have added your DockerHub account under Registries, this will be used to download the appropriate image.
Now you can opt to start the container from command line or within the Portainer itself.
3.1 From the command line
Once the container is made ready, access the portal to view the status of the newly created container (as per this example myubuntu).
You can now explore the quick actions menu to view logs, inspect the container and access its console.
3.2 From the Portainer console
The console eases the steps to create a container from within the console. Navigate to Container > Add Container to pull the image from the registry and enable necessary advanced settings to create the container.
Conclusion
While there are more features than what meets the eye, this is all you need to get started with Portainer. If you want to explore more and learn about the deployment scenarios , read it’s detailed documentation.