Skip to content

Instantly share code, notes, and snippets.

@natanlao
Last active March 30, 2021 22:35
Show Gist options
  • Save natanlao/e377128bb9a849a1bc535953a70a5855 to your computer and use it in GitHub Desktop.
Save natanlao/e377128bb9a849a1bc535953a70a5855 to your computer and use it in GitHub Desktop.
Dokku reference

I host side projects on a DigitalOcean droplet running Dokku. For reference:

One-time setup of Lets Encrypt

$ ssh [email protected] sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
$ ssh [email protected] dokku letsencrypt:cron-job --add

Creating an app

With a Dockerfile or Procfile:

$ ssh [email protected] apps:create $NAME
$ git remote add dokku [email protected]:$NAME
$ git push dokku master
$ ssh [email protected] config:set--no-restart $NAME DOKKU_LETSENCRYPT_EMAIL=${NAME}@natan.la
$ ssh [email protected] letsencrypt $NAME

Remember to map the subdomain with an A record to the droplet.

Add SSH key

$ ssh [email protected] sudo dokku ssh-tags:add github-deploy < id_ed25519.pub

Looking forward

Ideally, projects with a Dockerfile should be built "locally" (i.e., not on the droplet) since the droplet isn't particularly powerful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment