Skip to content

Deploying on Digital Ocean

looter edited this page May 5, 2016 · 6 revisions

Deploying grimd on digital ocean is incredibly easy.

I will be using a Digital Ocean $5/m droplet and Debian 8.3 x64, although any linux distribution will work just fine.

Installing Requirements

After your droplet is deployed and ready to go, ssh in and lets do some initial setup and grab nano for editing files.

apt-get update
apt-get upgrade
apt-get install nano -y

Installing grimd

Installing grimd is the easiest when you simply download a release from the releases page. Go ahead and copy the link for grimd_linux_x64 and run the following in your terminal.

mkdir ~/grim
cd ~/grim
wget <grimd release>

This will download the binary to ~/grim which will be grimd's working directory. First, lets setup file permissions for grimd, by running the following.

chmod a+x ./grimd_linux_x64

Setup is pretty much complete, the only thing left to do is run grimd and let it generate the default configuration and download the blocklists, but lets set it up as a systemd service so it automatically restarts and updates when starting.

Setting up the service

Create the grimd service by running the following,

nano /etc/systemd/system/grimd.service

Now paste in the code for the service below,

[Unit]
Description=grimd dns proxy
Documentation=https://github.com/looterz/grimd
After=network.target

[Service]
User=root
WorkingDirectory=/root/grim
LimitNOFILE=4096
PIDFile=/var/run/grimd/grimd.pid
ExecStart=/root/grim/grimd_linux_x64 -update
Restart=always
StartLimitInterval=30

[Install]
WantedBy=multi-user.target

Save, and now you can start, stop, restart and run status commands on the grimd service like follows

service grimd start

The only thing left to do is setup your clients to use your grimd dns server.

Security

Now that grimd is setup on your droplet, it's recommended to secure the installation from non-whitelisted clients.

Clone this wiki locally