{"id":24989113,"url":"https://github.com/engineervix/pre-dokku-server-setup","last_synced_at":"2025-07-26T20:37:22.795Z","repository":{"id":41437341,"uuid":"508469804","full_name":"engineervix/pre-dokku-server-setup","owner":"engineervix","description":"Initial Ubuntu VPS server setup prior to installation of Dokku","archived":false,"fork":false,"pushed_at":"2024-09-23T17:34:16.000Z","size":120,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T02:20:13.006Z","etag":null,"topics":["dokku","dokku-ready","shell","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/engineervix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-28T22:14:28.000Z","updated_at":"2024-09-02T00:08:22.000Z","dependencies_parsed_at":"2023-11-16T00:30:58.014Z","dependency_job_id":"d0ebe771-8390-4ae5-a784-0d6ece00e601","html_url":"https://github.com/engineervix/pre-dokku-server-setup","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/engineervix/pre-dokku-server-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineervix%2Fpre-dokku-server-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineervix%2Fpre-dokku-server-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineervix%2Fpre-dokku-server-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineervix%2Fpre-dokku-server-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/engineervix","download_url":"https://codeload.github.com/engineervix/pre-dokku-server-setup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engineervix%2Fpre-dokku-server-setup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267229049,"owners_count":24056374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dokku","dokku-ready","shell","ubuntu"],"created_at":"2025-02-04T12:16:54.140Z","updated_at":"2025-07-26T20:37:22.733Z","avatar_url":"https://github.com/engineervix.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ubuntu Server Setup for Dokku\n\n\u003e Initial Ubuntu VPS server setup prior to installation of [Dokku](https://dokku.com/).\n\n[![ShellCheck](https://github.com/engineervix/pre-dokku-server-setup/actions/workflows/main.yml/badge.svg)](https://github.com/engineervix/pre-dokku-server-setup/actions/workflows/main.yml)\n[![last commit](https://img.shields.io/github/last-commit/engineervix/pre-dokku-server-setup)](https://github.com/engineervix/pre-dokku-server-setup/commits/)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n![License](https://img.shields.io/github/license/engineervix/pre-dokku-server-setup)\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [Introduction](#introduction)\n- [Getting Started](#getting-started)\n- [Post setup actions](#post-setup-actions)\n- [Supported Ubuntu versions](#supported-ubuntu-versions)\n- [Running tests](#running-tests)\n- [Author](#author)\n- [Contributing 🤝](#contributing-)\n- [Show your support](#show-your-support)\n- [License 📝](#license-)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Introduction\n\nThis script uses Jason Hee's excellent [Ubuntu setup script](https://github.com/jasonheecs/ubuntu-server-setup) as a starting point for provisioning Ubuntu Servers in preparation for installation of [Dokku](https://dokku.com/).\n\n**Why not just use Jason Hee's script 🤔**?\n\nJason Hee's script is perfect! What this script does is that it adds a bunch of extra useful things such as ...\n\n- [Zsh](https://www.zsh.org/), [ohmyzsh](https://ohmyz.sh) + [some fancy terminal enhancements](https://github.com/athityakumar/colorls)\n- [Custom Vim Distribution](https://github.com/carlhuda/janus)\n- [tmux](https://github.com/tmux/tmux/wiki)\n- Optional [Postfix](http://www.postfix.org/) setup with either [Sendgrid](https://sendgrid.com/) or [MailJet](https://www.mailjet.com/)\n- [Automatic Security Updates](https://help.ubuntu.com/community/AutomaticSecurityUpdates)\n- [Logwatch](https://ubuntu.com/server/docs/logwatch)\n- [fail2ban](https://www.fail2ban.org/wiki/index.php/Main_Page) and a few other security features\n- and more.\n\n... 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.\n\n**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:\n\n```bash\n# v0.27.6 was the latest tag at the time this README was initially written\n# change to whatever the latest version will be when you read this\nwget https://raw.githubusercontent.com/dokku/dokku/v0.27.6/bootstrap.sh \u0026\u0026 \\\nsudo DOKKU_TAG=v0.27.6 bash bootstrap.sh\n```\n\n## Getting Started\n\n1. spin up a VPS using your preferred service provider ([DigitalOcean](https://www.digitalocean.com/), [Hetzner](https://www.hetzner.com/), [Linode](https://www.linode.com/), [Vultr](https://www.vultr.com/), etc.), ensuring that you\n   - set the server's hostname to the domain that you'll be using as [global domain on Dokku](https://dokku.com/docs/configuration/domains/). This will ensure `/etc/hostname` and the `hostname` command respond correctly (something Dokku relies on).\n   - specify an SSH key when bootstrapping your VPS\n2. Configure DNS.\n   - You'll need an A record for the naked domain (the \"`@`\" one) pointing to your IP with the lowest TTL possible\n   - You'll need a wildcard A record (use '`*`') pointing to your IP with the lowest TTL possible\n3. SSH into your server, clone this repository (\u0026 submodules) into your home directory, and run the setup script:\n\n   ```bash\n   cd ~\n   git clone --recurse-submodules https://github.com/engineervix/pre-dokku-server-setup.git \\\n   \u0026\u0026 cd pre-dokku-server-setup \\\n   \u0026\u0026 bash setup.sh\n   ```\n\n   **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`):\n\n   ```shell\n   --mailjet   # setup postfix with MailJest\n   --sendgrid  # setup postfix with Sendgrid\n   --texlive   # install texlive-full\n   ```\n\n   **Note**: if you select both `--mailjet` and `--sendgrid`, the script will terminate with an `exit 1` code, and you'd have to try again.\n\nWhen the setup script is run, you will be prompted\n\n- to enter the username of the new user account\n- to add a public ssh key (which should be from your local machine) for the new account. You can display it on your local terminal via (assuming it's called `id_rsa.pub` and it's in the `~/.ssh/` directory.\n\n  Feel free to change the path / name if you saved it in a different location / named it differently) ...\n\n  ```bash\n  cat ~/.ssh/id_rsa.pub\n  ```\n\n  ... then copy it and paste it in the terminal on your server.\n\n  **Note** » If you don't have an existing key and you would like to generate one, or perhaps you already have one and would like to generate another ssh key from your local machine:\n\n  ```bash\n  ssh-keygen -t ed25519 -C \"your_email@example.com\"\n  ```\n\n- to specify a [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for the server. It will be set to 'Africa/Lusaka' if you do not specify a value.\n- When setting up Postfix and configuring System Updates and Notification Settings, you'll be asked for\n\n  - the System Administrator's email address (to **receive** notifications)\n  - the email address that'll be associated with **send**ing emails. You need to use a Mailjet OR Sendgrid verified email address for this.\n\n  \u003e This script assumes that the email address you supply is associated with your Mailjet/Sendgrid domain. `myhostname` is therefore extracted from this email address. So, if your \"mail_from\" email address is josh@example.co.zm, then example.co.zm will be used as `myhostname` in the Postfix setup.\n\n## Post setup actions\n\n- [ ] Reboot and login as the new user\n- [ ] Test your email configuration. See example below:\n\n  Here's an example to test that your email works. I use the awesome [mail-tester.com](https://www.mail-tester.com) and with this configuration you should get a ~10/10 score. Remember to change **recipient@someplace.com** with whatever email address you'll get when you go to [mail-tester.com](https://www.mail-tester.com).\n\n  ```bash\n  echo \"Hi there, this is my test message, and I am sending it to you\\!\" | mutt -s \"Hello from your server\" recipient@someplace.com\n  ```\n\n- [ ] On Ubuntu 22.04, you'll need to fix your vim config as follows: (see \u003chttps://github.com/amix/vimrc/issues/645#issuecomment-1120374288\u003e)\n\n  ```bash\n  cd ~/.vim/janus/vim/tools/tlib/plugin/ \u0026\u0026 \\\n  git pull origin master\n  ```\n\n- [ ] Install Dokku, setup your projects and deploy 🚀. I created [this gist](https://gist.github.com/engineervix/8d1825a7301239e7c4df3af78aaee9a4) to serve as a goto reference for deploying (mostly Django) applications to Dokku.\n\n  ```bash\n  # v0.27.6 was the latest tag at the time this README was initially written\n  # change to whatever the latest version will be when you read this\n  ```\n\n  ```bash\n  wget https://raw.githubusercontent.com/dokku/dokku/v0.27.6/bootstrap.sh \u0026\u0026 \\\n  sudo DOKKU_TAG=v0.27.6 bash bootstrap.sh\n  ```\n\n  **Some excellent resources**:\n\n  - [How to deploy Django project to Dokku](https://www.accordbox.com/blog/how-deploy-django-project-dokku/#introduction)\n  - [Setting up Dokku with DigitalOcean and Namecheap (GitHub gist)](https://gist.github.com/djmbritt/10938092)\n  - [Deploying an app with Dokku](https://vitobotta.com/2022/02/16/deploying-an-app-with-dokku/)\n  - [Dokku Docs: Process Management](https://dokku.com/docs/processes/process-management/)\n  - [Dokku Docs: Zero Downtime Deploys](https://dokku.com/docs/deployment/zero-downtime-deploys/)\n  - [Dokku with Let's Encrypt behind Cloudflare](https://spiffy.tech/dokku-with-lets-encrypt-behind-cloudflare)\n  - [Cloudflare certificates + Dokku](https://okhlopkov.com/cloudflare-certificates-dokku/)\n  - [Securing Dokku with Let's Encrypt TLS Certificates](https://blog.semicolonsoftware.de/securing-dokku-with-lets-encrypt-tls-certificates/)\n\n- [ ] [Fix `apt-key` Deprecation Warning on Ubuntu](https://www.omgubuntu.co.uk/2022/06/fix-apt-key-deprecation-error-on-ubuntu)\n\n  In our case, it'll be something along these lines:\n\n  ```bash\n  sudo apt-key export 86E50310 | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/yarn.gpg \u0026\u0026 \\\n  sudo apt-key export 12576482 | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/lynis.gpg \u0026\u0026 \\\n  sudo apt-key export 288B3315 | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/dokku.gpg\n  ```\n\n  **Note**: better to first check with `sudo apt-key list`, as described in [How to Fix ‘apt-key’ Deprecation Warning on Ubuntu](https://www.omgubuntu.co.uk/2022/06/fix-apt-key-deprecation-error-on-ubuntu)\n\n## Supported Ubuntu versions\n\nJason Hee's excellent [Ubuntu setup script](https://github.com/jasonheecs/ubuntu-server-setup) 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**).\n\n## Running tests\n\nTests are run against a set of Vagrant VMs. To run the tests, run the following in the project's directory:\n\n`./tests/tests.sh`\n\n## Author\n\n👤 **Victor Miti**\n\n- Blog: \u003chttps://blog.victor.co.zm\u003e\n- Twitter: [![Twitter: engineervix](https://img.shields.io/twitter/follow/engineervix.svg?style=social)](https://twitter.com/engineervix)\n- Github: [@engineervix](https://github.com/engineervix)\n\n## Contributing 🤝\n\nContributions, issues and feature requests are most welcome!\n\nFeel free to check the [issues page](https://github.com/engineervix/pre-dokku-server-setup/issues) and take a look at the [contributing guide](CONTRIBUTING.md) before you get started\n\n## Show your support\n\nPlease give a ⭐️ if you found this project helpful!\n\n## License 📝\n\nCopyright © 2022 [Victor Miti](https://github.com/engineervix).\n\nThis project is licensed under the terms of the [MIT](https://github.com/engineervix/pre-dokku-server-setup/blob/main/LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineervix%2Fpre-dokku-server-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengineervix%2Fpre-dokku-server-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineervix%2Fpre-dokku-server-setup/lists"}