This guide is written with Debian as a starting point, but with minor adaptations will work on any Debian-based system e.g. Ubuntu or Kali.
The steps themselves apply to any system so with some know-how and elbow grease this can be applied to MacOS X or other Linux flavors.
Guide tested on:
- Linux 4.19.0-6-cloud-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux
- Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux
- Update system
- Setup user account
- Install Node
- Install Yarn
- Install Docker
- Install Nginx (Optional)
- Install Certbot (Optional)
- Install D2 CLI
- Launch development cluster
- System cleanup (Optional)
Install the base dependencies we are going to need.
Abbreviated instructions below, if any problems occur see the full Node installation instructions.
Set up the sources.
ℹ️ After adding a new source to
apt, we need to run the
Test the Node install with:
Add the Apt sources.
Test the Yarn install with:
While Docker exists in the standard repositories, the versions for Docker and Docker Compose that are considered stable by Debian are too old for us to use, so we need to install the versions that Docker considers stable.
Other distros (e.g. Ubuntu) are faster about adopting new versions, so they may be current enough. Either way, using the Docker repos guarantees functionality, and faster security patches. Which you do want considering what Docker does and fundamentally is.
Installing Docker is more involved than the other commands, the full instructions used for the abbreviated set are provided here:
Install the dependencies.
Add the Docker source repository to Apt.
Install the Docker packages.
Set up a group for Docker. Tt may already exist and if so, that's OK. Simply
proceed with the commands after
If these commands fail, that's OK. If you run into permission errors down the line, come back and run these again.
If you do not want all the Docker data on your main partition (
as it may consume a lot of space, you can change that adding some configuration
to the Docker daemon config file in
To configure if Docker starts on boot or not:
Docker Compose is a single binary that we can just download and plop into our
/usr/local/bin directory. Note that the directory varies from distro to
distro, you want the local binary directory for userland.
Mark it as executable after inspecting the binary.
Test out the install with:
The standard package for Nginx is solid and stable.
This overwrites the Nginx default site. If you want to preserve that, add this as a new vhost.
Start the Nginx service and enable it to start on boot.
Run the tool to setup certificates for sites configured in Nginx:
ℹ️ After setting up a certificate with certbot, usually I have to clean up my Nginx
To simulate a renewal, use:
For the real deal run without the
--dry-run switch. You will want to do this
every month or so.
Can be installed using Yarn (recommended):
ℹ️ NPM can be used, but is not recommended for many reasons. If Yarn is unacceptable, use
Add the global Yarn packages
.bin directory to your
PATH so that you can
easily execute the commands:
For shells other than Bash, a different
.profile file is needed, e.g.
.zsh_profile for ZSH. If no shell specific profile file is found or used,
.profile would work in most cases.
If you have the
~/.config/d2/config.js file, starting is as easy as:
Without the configuration file, the equivalent is: