Build an Ubuntu server with Docker

dockerIf you need your own Docker server, it can be installed on an Ubuntu server. This article describes the process.

Install with Ubuntu Snap

I recommend you start with 8GB memory.

  1. Start by downloading Ubuntu 18.04 LTS.
  2. Boot the server using the downloaded Ubuntu software.
  3. Choose your Language.
  4. Select Update to the new installer, to use the latest version of the installer.
  5. Select your Keyboard layout.
  6. Confirm that at least one Network connection is configured properly.
  7. You can typically leave Proxy address as blank.
  8. You can leave the default Mirror address.
  9. Select Use an entire disk for storage.
  10. Click Done, to confirm your Storage configuration, and click Continue to confirm your selection.
  11. Enter the following details:
    1. Your name: (e.g. Steven Pryer)
    2. Your server's name: (e.g. ubuntu-docker)
    3. Pick a username: (e.g. steven)
    4. Choose a password:
  12. Select the option to Install OpenSSH server, so that you can remotely access your server.
  13. From the list of Featured Server Snaps, select docker.

The installation will now be processed, and will typically take about a minute. Click Reboot when it's finished. Ubuntu will now take a few minutes to deploy itself with Docker.


Standard Install Docker

This is the traditional way to install Docker, and will get you a more recent version installed. Install Ubuntu as above, but skip the last step.

Start by installing the dependencies

$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Now install the Docker GPG key

$ curl -fsSL | sudo apt-key add -

Check you have the right GPG key

$ sudo apt-key fingerprint 0EBFCD88

Add the latest stable Docker repository

$ sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
$ sudo apt-get update

Install the Docker Engine

$ sudo apt-get install docker-ce docker-ce-cli

Docker is now installed. Run the following command to check which version you are running.

$ sudo docker --version


Initial configuration

Here are some initial configurations that you might make to your fresh Docker install.

  1. Install Docker Compose.
  2. Install Portainer.


Thanks for visiting.