Skip to content

Environment Setup - Linux

This guide provides step-by-step instructions on how to install Python 3.10 and Docker on your Ubuntu system using the default package manager and official Docker repositories.


  • Ubuntu operating system
  • Administrator access to your Ubuntu system
  • An internet connection

Step 1: Update and Upgrade Ubuntu Packages

Before installing new software, it's a good practice to update your Ubuntu package list and upgrade the existing packages to their latest versions.

  1. Open the Terminal.

  2. Update the package list:

    sudo apt update
  3. Upgrade the installed packages:

    sudo apt upgrade -y

Step 2: Install Python 3.10

Ubuntu repositories maintain multiple Python versions, making it easy to install Python 3.10.

  1. Install Python 3.10 by running:

    sudo apt install python3.10
  2. Once installed, check the Python version:

    python3.10 --version

    The output should confirm the installed version of Python, Python 3.10.x.

Step 3: Install Docker

Installing Docker on Ubuntu requires adding Docker's official repository to ensure you're installing the latest version.

  1. Install prerequisite packages to allow apt to use a repository over HTTPS:

    sudo apt install apt-transport-https ca-certificates curl software-properties-common
  2. Add Docker’s official GPG key:

    curl -fsSL | sudo apt-key add -
  3. Add the Docker repository to APT sources:

    sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
  4. Update the package database with the Docker packages from the newly added repo:

    sudo apt update
  5. Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:

    apt-cache policy docker-ce
  6. Install Docker:

    sudo apt install docker-ce
  7. Verify that Docker is installed correctly by running the Docker command:

    sudo docker run hello-world

    This command downloads a test image and runs it in a container. If the container runs successfully, it indicates that Docker is installed and working correctly.

Step 4: Manage Docker as a Non-root User

By default, the Docker daemon binds to a Unix socket instead of a TCP port. By default, the Unix socket is owned by the user root, and other users can only access it using sudo. To run Docker commands without sudo, you must add your user to the docker group.

  1. Create the docker group if it doesn't already exist:

    sudo groupadd docker
  2. Add your user to the docker group:

    sudo usermod -aG docker $USER
  3. Log out and log back in so that your group membership is re-evaluated.

  4. Verify that you can run Docker commands without sudo:

    docker run hello-world