Running a Container for Data Science on a Cloud Server

The Ubuntu repository may contain an outdated Docker version, so this instruction describes how to install the recent version from the official Docker repository:

  1. Create a cloud server according to the instructions.

  2. Update the current list of packages.

    sudo apt update
  3. Install the tools that will allow apt to use HTTPS.

    sudo apt install apt-transport-https ca-certificates curl software-properties-common
  4. Add the GPG key for the official Docker repository.

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  5. Add the Docker repository to the APT resources.

    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
  6. Update the database with Docker packages from the added repository.

    sudo apt update
  7. Make sure you install the package from the Docker repository (and not from the default Ubuntu repository).

    apt-cache policy docker-ce
  8. The output will be similar to this (the Docker version may differ):

    Output of apt-cache policy docker-ce
    docker-ce:
    Installed: (none)
    Candidate: 18.03.1~ce~3-0~ubuntu
    Version table:
     18.03.1~ce~3-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
  9. Install Docker.

    sudo apt install docker-ce
  10. Make sure that Docker is working.

    sudo systemctl status docker

    The output should be similar to this, showing that the service is up and running:

    Output
    ● docker.service - Docker Application Container Engine
    Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
    Active: active (running) since Thu 2018-07-05 15:08:39 UTC; 2min 55s ago
     Docs: https://docs.docker.com
    Main PID: 10096 (dockerd)
    Tasks: 16
    CGroup: /system.slice/docker.service
           ├─10096 /usr/bin/dockerd -H fd://
           └─10113 docker-containerd --config /var/run/docker/containerd/containerd.toml
               
  11. Download the container from the repository.

    docker pull selectel/selectel-ml
  12. Start the container.

    docker run -d -p 8888:8888 selectel/selectel-ml
  13. Run Jupyter Notebook: enter the external server IP address and the port number from the previous step in the address bar of your browser. For example: 203.0.113.1:8888. In the Jupyter Notebook web interface that opens, enter the default password: 9lG0eXCevt.

Learn more about how to change your password in the Jupyter Notebook documentation.