Bobcares

Install Portainer Docker Ubuntu: Complete guide.

by | Jul 31, 2022

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

install portainer 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.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF