How to Setup Docker on Ubuntu

Before starting, if you intend to use YOURNAME.synchro.net, you should go ahead and create an account on |Vertrauen in order to access DoveNet as well as the synchro.net dynamic dns service. You can also bring your own registered domain, or use any domain (such as YOURNAME.bbs.io) via freedns.afraid.org.

You should create a public/private key pair for SSH before creating your VM, for many providers, this will allow you to have passwordless SSH access.

Windows Users

Windows Users should Install WSL2 on a recent version of Windows 10 followed by Ubuntu 20.04 in the Windows Store, then install Docker Desktop for Windows.

With the above in place, you can then refer to Install Synchronet for Docker and disregard any Docker or UFW directions below.

Installing Ubuntu Server

You should start with a fresh install of Ubuntu Server. You should use the latest LTS version (As of today, 20.04). If you want to use a web host, you can use Digital Ocean, Linode or almost any other Linux VPS provider.

It is recommended to use a VPS with at least 2GB Ram for Docker usage.

When creating your Droplet/VM, specify a host name that matches the name the server will use such as foo.synchro.net or foo.bbs.io.

After your VM/VPS is up and running, connect over SSH, edit /etc/ssh/sshd_config and set the port to something other than 22 (such as 65022) so that the default port is available to Synchronet, then restart the server.

After you have changed the SSH port, and restarted, connect again over SSH.

  ssh -p 65022 root@yourserver
  

Now you should install and enable ufw (ubuntu's Uncomplicated Firewall).

  sudo apt-get install ufw
  ufw allow 65022
  ufw enable

Installing Docker

The instructions in this section are copied from docker.org for x86_64, for other platforms click here.

If using a VPS with root, you can omit the sudo portion of the commands below.

  sudo apt-get update
  sudo apt-get install \
       apt-transport-https \
       ca-certificates \
       curl \
       gnupg-agent \
       software-properties-common
       
  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  
  sudo add-apt-repository \
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
       $(lsb_release -cs) \
       stable"
       
  sudo apt-get update
  
  sudo apt-get install docker-ce docker-ce-cli containerd.io
  

Finally, in addition to the instructions on docker.com, install docker-compose

  sudo apt-get install docker-compose

Installing Synchronet

Now that you have Docker installed and prepared, you can Install Synchronet for Docker.

After installing Synchronet, you should enable the ports that Synchronet expects to use.

  ufw allow 80
  ufw allow 443
  ufw allow 1123
  ufw allow 11235
  ufw allow 21
  ufw allow 22
  ufw allow 23
  ufw allow 513
  ufw allow 64
  ufw allow 128
  ufw allow 25
  ufw allow 587
  ufw allow 465
  ufw allow 110
  ufw allow 995
  ufw allow 119
  ufw allow 563
  ufw allow 18
  ufw allow 11
  ufw allow 17
  ufw allow 79
  ufw allow 6667

Remote Editing

In order to make life easier, you may consider installing Visual Studio Code and then install the Remote Development extension pack, which will allow for SSH and WSL remote editing.

The following contents in sbbs/.vscode/settings.json will make using VS Code easier and align well with the files in your sbbs directory.

  {
    "files.associations": {
      "*.ssjs": "javascript",
    },
    "[plaintext]": {
      "files.encoding": "cp437",
      "editor.renderControlCharacters": true,
    }
  }

See Also

howto/docker.txt · Last modified: 2021/05/04 16:19 by tracker1
Back to top
CC Attribution 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0