Set up your VPS

This page provides a walk-through guide to prepare your VPS to install Open edX.

We recommend starting with a clean install to prevent package or software version conflicts

  1. Configure a non-root user with sudo privileges

    This example creates a user called edx

    # This command creates a user called "edx", but you can use any name
    useradd -d /home/edx -m edx -s /bin/bash
    # Set the password
    passwd edx
    # Add to sudo group
    usermod -aG sudo edx
  2. Install essential packages

    sudo apt update && sudo apt -y upgrade
    sudo apt -y install zip unzip fail2ban ufw htop python3 python3-pip
  3. Configure your firewall to allow ports 22, 80 and 443.

    sudo ufw allow ssh
    sudo ufw allow http
    sudo ufw allow https
    sudo ufw enable

    Verify that UFW is enabled

    sudo ufw status verbose
  4. Install Docker and Docker Compose

    Do not install Docker using apt-get install docker docker-compose.
    Tutor will not install correctly using an older version of Docker.

    1. Install the latest version of Docker (Reference site)

      sudo apt-get update
      sudo apt-get -y install \
        apt-transport-https \
        ca-certificates \
        curl \
        gnupg-agent \
      curl -fsSL | sudo apt-key add -
      sudo add-apt-repository -y \
       "deb [arch=amd64] \
       $(lsb_release -cs) \
      sudo apt update && sudo apt -y install docker-ce docker-ce-cli
    2. Install Docker Compose (Reference site)

      sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
      sudo chmod +x /usr/local/bin/docker-compose
      sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
  5. Add the non-root user to docker group

    Note: This example uses a user named edx

    sudo groupadd docker
    sudo usermod -aG docker edx
    sudo newgrp docker

    Verify that your user can use Docker. You might need to log out and then log back in.

    docker run hello-world