Home

Awesome

Ubuntu Server Setup for Dokku

Initial Ubuntu VPS server setup prior to installation of Dokku.

ShellCheck last commit Commitizen friendly License

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->

Introduction

This script uses Jason Hee's excellent Ubuntu setup script as a starting point for provisioning Ubuntu Servers in preparation for installation of Dokku.

Why not just use Jason Hee's script ๐Ÿค”?

Jason Hee's script is perfect! What this script does is that it adds a bunch of extra useful things such as ...

... so if you're not interested in these things and just want to quickly get up and running with Dokku, then use Jason Hee's script.

Note: the script doesn't install Dokku, you have to restart the server after running this script, and login as the newly created user, then install Dokku like this:

# v0.27.6 was the latest tag at the time this README was initially written
# change to whatever the latest version will be when you read this
wget https://raw.githubusercontent.com/dokku/dokku/v0.27.6/bootstrap.sh && \
sudo DOKKU_TAG=v0.27.6 bash bootstrap.sh

Getting Started

  1. spin up a VPS using your preferred service provider (DigitalOcean, Hetzner, Linode, Vultr, etc.), ensuring that you

    • set the server's hostname to the domain that you'll be using as global domain on Dokku. This will ensure /etc/hostname and the hostname command respond correctly (something Dokku relies on).
    • specify an SSH key when bootstrapping your VPS
  2. Configure DNS.

    • You'll need an A record for the naked domain (the "@" one) pointing to your IP with the lowest TTL possible
    • You'll need a wildcard A record (use '*') pointing to your IP with the lowest TTL possible
  3. SSH into your server, clone this repository (& submodules) into your home directory, and run the setup script:

    cd ~
    git clone --recurse-submodules https://github.com/engineervix/pre-dokku-server-setup.git \
    && cd pre-dokku-server-setup \
    && bash setup.sh
    

    Note: If you run the script with no arguments, it will neither setup postfix on your server nor download texlive-full. The following optional arguments are available (for help, you can simply run bash setup.sh -h or bash setup.sh --help):

    --mailjet   # setup postfix with MailJest
    --sendgrid  # setup postfix with Sendgrid
    --texlive   # install texlive-full
    

    Note: if you select both --mailjet and --sendgrid, the script will terminate with an exit 1 code, and you'd have to try again.

When the setup script is run, you will be prompted

Post setup actions

Supported Ubuntu versions

Jason Hee's excellent Ubuntu setup script has been tested against Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04, Ubuntu 20.04 and 22.04. However, this project primarily targets Ubuntu 20.04 and Ubuntu 22.04 (It'll most likely also work on 18.04).

Running tests

Tests are run against a set of Vagrant VMs. To run the tests, run the following in the project's directory:

./tests/tests.sh

Author

๐Ÿ‘ค Victor Miti

Contributing ๐Ÿค

Contributions, issues and feature requests are most welcome!

Feel free to check the issues page and take a look at the contributing guide before you get started

Show your support

Please give a โญ๏ธ if you found this project helpful!

License ๐Ÿ“

Copyright ยฉ 2022 Victor Miti.

This project is licensed under the terms of the MIT license.