Let’s look at how to install portainer Docker on Ubuntu. With our Docker hosting support, we can give you a complete step by step by guide on how to install and manage Portainer docker on Ubuntu.
Do you want to know more? Continue reading and contact us if you have any further questions.
Install Docker Ubuntu
Installing the docker is the first step to set up Portainer docker in Ubuntu. Add the Docker official repository to the Ubuntu system to get the latest version automatically. To do so, run the following commands to install the prerequisite packages:
sudo apt update
sudo apt-get install
apt-transport-https ca-certificates curl gnupg-agent software-properties-common
Then, execute the commands below to obtain and install Docker’s official GPG key. The key verifies the trustworthiness of packages installed from Docker’s repository.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
The response would be as follows:
Response:
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <docker@docker.com>
sub rsa4096 2017-02-22 [S]
After the installation of the official GPG key, use the commands below to add its stable repository to Ubuntu. To add the nightly or test repository, follow the phrase stable with the words nightly or test (or both).
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Docker’s official GPG and repository should now be on display on Ubuntu.
Run the following commands to uninstall previous versions of Docker:
sudo apt-get remove docker docker-engine docker.io containerd runc
After deleting all prior versions of Docker, use the following instructions to install the most recent stable version of Docker:
Note that to run the apt-cache command to install a specific version of Docker. Then choose the version to install.
apt-cache madison docker-ce
Output:
docker-ce | 5:19.03.12~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:19.03.11~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:19.03.10~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
docker-ce | 5:19.03.9~3-0~ubuntu-focal | https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
....
To install a specific version, use the following instructions and the version to install:
sudo apt-get install docker-ce=5:19.03.10~3-0~ubuntu-focal docker-ce-cli=5:19.03.10~3-0~ubuntu-focal containerd.io
Run the commands below to get the newest version without providing the above. The following command will always install the most recent version:
sudo apt-get install docker-ce docker-ce-cli containerd.io
Docker software will be installed on Ubuntu.
Add the account, which will most likely be ubuntu, to the Docker group and restart:
sudo usermod -aG docker $USER
Restart the instance.
sudo reboot
To ensure that Docker CE is properly installed and that the hello-world image can be run:
sudo docker run hello-world
If Docker is correctly installed, the following response will be displayed:
Response:
Hello from Docker! This message indicates that the installation looks to be functioning properly. To generate this message, Docker took the following steps:
1. The Docker daemon established contact with the Docker client.
2.Docker daemon downloaded the "hello-world" image from Docker Hub. (amd64)
3. The Docker daemon generated a new container from that image, which executes the software that generates the output you're seeing now.
4. That output was transmitted by the Docker daemon to the Docker client, who then sent it to your terminal.
Open Putty and SSH into the server to install Docker-Compose.
Then execute the following command:
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
Then, configure the permissions:
sudo chmod +x /usr/local/bin/docker-compose
Create Portainer Volume
Firstly make the Portainer volume while Putty is still open.
sudo docker volume create portainer_data
Create the Portainer container next:
sudo docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /srv/portainer:/data portainer/portainer
Start the Docker container
sudo docker start portainer
Portainer should now be running at the IP address and port 9000 of the server. (i.e. – 192.168.68.141:9000). To find and identify the server’s IP address, enter ifconfig into the terminal.
As the login is admin and there is no default password, generate a new one. This is a local server, hence choose Local, and then click Connect. Existing Docker containers are displayed in the Local section if they exist. This is the final step to install the portainer docker on ubuntu.
[Need assistance with similar queries? We are here to help]
Conclusion
To conclude, ‘install the portainer docker on ubuntu‘ is easy and will consume a small amount of time to complete. Installing Docker the compose and creating the portainer volume and rebooting the docker container fill finish the process.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
var google_conversion_label = "owonCMyG5nEQ0aD71QM";
0 Comments