Last updated on 2018-07-01.
The following components and tools will be used:
More information can be found in the Resources section at the bottom of the guide.
For this guide, I went for the smallest VPS available from DigitalOcean, a Droplet with 1 CPU, 1 GiB RAM and 25 GiB SSD storage, which costs $5/month ($0.007/hour):
Select Debian 9
as the Droplet distribution:
<img src="../images/01-create-droplet-distro.jpg"
width="500px"
alt="Droplet distribution" />
Choose a region that is geographically close to you:
<img src="../images/02-create-droplet-region.jpg"
width="500px"
alt="Droplet region" />
Choose a Droplet size that corresponds to your usage and budget:
<img src="../images/03-create-droplet-size.jpg"
width="500px"
alt="Droplet size" />
Finalize the Droplet creation:
<img src="../images/04-finalize.jpg"
width="500px"
alt="Droplet finalization" />
Droplet information is displayed on the Control Panel:
<img src="../images/05-droplet.jpg"
width="500px"
alt="Droplet summary" />
Once your VPS has been created, you will receive an e-mail with connection instructions.
After creating your VPS, it will be reachable using its IP address; some hosting
providers also create a DNS record, e.g. ns4853142.ip-01-47-127.eu
.
A domain name (DNS record) is required to obtain a certificate and setup HTTPS (HTTP with TLS encryption).
Domain names can be obtained from registrars through hosting providers such as Gandi.
Once you have your own domain, you need to create a new DNS record that points to your VPS' IP address:
<img src="../images/06-domain.jpg"
width="650px"
alt="Domain configuration" />
Now's the time to connect to your freshly created VPS!
$ ssh root@188.166.85.8
Linux stretch-shaarli-02 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Jul 1 11:20:18 2018 from <REDACTED>
root@stretch-shaarli-02:~$
root@stretch-shaarli-02:~$ apt update && apt upgrade -y
The following instructions are from the Get Docker CE for Debian guide.
Install package dependencies:
root@stretch-shaarli-02:~$ apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
Add Docker's package repository GPG key:
root@stretch-shaarli-02:~$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
Add Docker's package repository:
root@stretch-shaarli-02:~$ add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable"
Update package lists and install Docker:
root@stretch-shaarli-02:~$ apt update && apt install -y docker-ce
Verify Docker is properly configured by running the hello-world
image:
root@stretch-shaarli-02:~$ docker run hello-world
The following instructions are from the Install Docker Compose guide.
Download the current version from the release page:
root@stretch-shaarli-02:~$ curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
root@stretch-shaarli-02:~$ chmod +x /usr/local/bin/docker-compose
Shaarli comes with a configuration file for Docker Compose, that will setup:
Træfik is a modern HTTP reverse proxy, with native support for Docker and Let's Encrypt.
Create a new directory to store the configuration:
root@stretch-shaarli-02:~$ mkdir shaarli && cd shaarli
root@stretch-shaarli-02:~/shaarli$
Download the current version of Shaarli's docker-compose.yml
:
root@stretch-shaarli-02:~/shaarli$ curl -L https://raw.githubusercontent.com/shaarli/Shaarli/master/docker-compose.yml -o docker-compose.yml
Create the .env
file and fill in your VPS and domain information (replace
<MY_SHAARLI_DOMAIN>
and <MY_CONTACT_EMAIL>
with your actual information):
root@stretch-shaarli-02:~/shaarli$ vim .env
SHAARLI_VIRTUAL_HOST=<MY_SHAARLI_DOMAIN>
SHAARLI_LETSENCRYPT_EMAIL=<MY_CONTACT_EMAIL>
root@stretch-shaarli-02:~/shaarli$ docker-compose pull
Pulling shaarli ... done
Pulling traefik ... done
root@stretch-shaarli-02:~/shaarli$ docker-compose up -d
Creating network "shaarli_http-proxy" with the default driver
Creating volume "shaarli_traefik-acme" with default driver
Creating volume "shaarli_shaarli-data" with default driver
Creating shaarli_shaarli_1 ... done
Creating shaarli_traefik_1 ... done
Congratulations! Your Shaarli instance should be up and running, and available
at https://<MY_SHAARLI_DOMAIN>
.
<img src="../images/07-installation.jpg"
width="500px"
alt="Shaarli installation page" />