Skip to content

Instantly share code, notes, and snippets.

@scootcho
Forked from ungoldman/dokku_setup.md
Created July 4, 2022 08:19
Show Gist options
  • Save scootcho/3040e1e9823c0c9cadd2e30f3a00b75d to your computer and use it in GitHub Desktop.
Save scootcho/3040e1e9823c0c9cadd2e30f3a00b75d to your computer and use it in GitHub Desktop.

Revisions

  1. @ungoldman ungoldman revised this gist Jun 21, 2019. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -8,11 +8,13 @@

    **This write-up is very out of date! You probably shouldn't use it.**

    I wrote an updated guide which you can find here: https://ungoldman.com/articles/web-application-deployment-on-a-budget/
    I wrote an updated guide which you can find here:

    My friend Paul wrote an article based on this write up too: http://paulcpederson.com/articles/make-your-own-heroku/
    https://ungoldman.com/articles/web-application-deployment-on-a-budget/

    My friend Paul wrote an article based on this write up too:

    http://paulcpederson.com/articles/make-your-own-heroku/

    ---

  2. @ungoldman ungoldman revised this gist Jun 21, 2019. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,9 @@

    **This write-up is very out of date! You probably shouldn't use it.**

    My friend Paul wrote an article based on this write up that's a bit more fleshed out: http://paulcpederson.com/articles/make-your-own-heroku/
    I wrote an updated guide which you can find here: https://ungoldman.com/articles/web-application-deployment-on-a-budget/

    My friend Paul wrote an article based on this write up too: http://paulcpederson.com/articles/make-your-own-heroku/



  3. @ungoldman ungoldman revised this gist Jul 21, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,10 @@

    **This write-up is very out of date! You probably shouldn't use it.**

    My friend Paul wrote an article based on this write up that's a bit more fleshed out: http://paulcpederson.com/articles/make-your-own-heroku/



    ---

    This write-up owes a great deal to [dscape](http://twitter.com/dscape)'s [Node.js Deployments with Docker, Dokku, & Digital Ocean](https://medium.com/code-adventures/438bce155dcb), the [dokku](https://github.com/progrium/dokku) project itself, and the fine folks working on dokku's [issues](https://github.com/progrium/dokku/issues). I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.
  4. @ungoldman ungoldman revised this gist Feb 2, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@

    ---

    This write-up is very out of date! You probably shouldn't use it.
    **This write-up is very out of date! You probably shouldn't use it.**

    ---

  5. @ungoldman ungoldman revised this gist Feb 2, 2016. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,12 @@

    ..or how I made my own heroku in a few hours for $3.98.

    ---

    This write-up is very out of date! You probably shouldn't use it.

    ---

    This write-up owes a great deal to [dscape](http://twitter.com/dscape)'s [Node.js Deployments with Docker, Dokku, & Digital Ocean](https://medium.com/code-adventures/438bce155dcb), the [dokku](https://github.com/progrium/dokku) project itself, and the fine folks working on dokku's [issues](https://github.com/progrium/dokku/issues). I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

    ## 1. Get a domain
  6. @ungoldman ungoldman revised this gist Oct 21, 2015. No changes.
  7. @ungoldman ungoldman revised this gist Oct 21, 2015. No changes.
  8. @ngoldman ngoldman revised this gist Jan 14, 2014. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -51,10 +51,10 @@ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
    ## 5. Configure Dokku

    ```sh
    cat ~/.ssh/id_rsa.pub | ssh progriumapp.com "sudo sshcommand acl-add dokku name"
    cat ~/.ssh/id_rsa.pub | ssh [email protected] "sudo sshcommand acl-add dokku $NAME"
    ```

    In this case dokku is the user associated with the dokku command (already created by dokku's bootstrap.sh), so it should not be changed. The `name` parameter is the name of the SSH key you're adding (so that it can be removed later by name if necessary). `name` *should* be changed (might be a good idea to use the name you gave to the same SSH key on Digital Ocean).
    In this case dokku is the user associated with the dokku command (already created by dokku's bootstrap.sh), so it should not be changed. The `$NAME` parameter is the name of the SSH key you're adding (so that it can be removed later by name if necessary). `$NAME` *should* be changed (might be a good idea to use the name you gave to the same SSH key on Digital Ocean).

    ## 6. Deploy an App to a subdomain

    @@ -66,6 +66,8 @@ git remote add dokku [email protected]:your-app-name

    In my case I ran `git remote add valis [email protected]:pedestrian` followed by `git push valis master` to deploy a dummy application to http://pedestrian.valis.pw. It worked!

    Don't forget that your app still needs to conform to whatever the [buildpacks](https://github.com/progrium/buildstep#supported-buildpacks) are expecting. For example, a node.js app needs a `package.json` file listing dependencies to install and a `Procfile` specifying what processes to run.

    ## 7. Deploy an App to the root domain

    This is detailed on [this page](https://github.com/progrium/dokku/wiki/Deploying-to-root-and-subdomains) of dokku's github wiki (took a little searching to actually track this down).
  9. @ngoldman ngoldman revised this gist Dec 28, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    ..or how I made my own heroku in a few hours for $3.98.

    This write up owes a great deal to [dscape](http://twitter.com/dscape)'s [Node.js Deployments with Docker, Dokku, & Digital Ocean](https://medium.com/code-adventures/438bce155dcb), the [dokku](https://github.com/progrium/dokku) project itself, and the fine folks working on dokku's [issues](https://github.com/progrium/dokku/issues). I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.
    This write-up owes a great deal to [dscape](http://twitter.com/dscape)'s [Node.js Deployments with Docker, Dokku, & Digital Ocean](https://medium.com/code-adventures/438bce155dcb), the [dokku](https://github.com/progrium/dokku) project itself, and the fine folks working on dokku's [issues](https://github.com/progrium/dokku/issues). I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

    ## 1. Get a domain

  10. @ngoldman ngoldman revised this gist Nov 5, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -76,7 +76,7 @@ Basically all you need to do is make the part of the git address after the colon
    git remote add dokku [email protected]:your.domain
    ```

    So for my setup, I'm doing `git remote add valis [email protected]:valis.pw` to deploy a very basic Node.js app ([source](https://github.com/ngoldman/valis.pw)). Though it's not explicitly stated in the wiki, this will work for *any* domain as long as that domain's A Record is pointing at your droplet's IP. Dokku takes care of setting up the vhost for you, so once it's done building, it should *just work*.
    So for my setup, I'm doing `git remote add valis [email protected]:valis.pw` to deploy a very basic Node.js app ([source](https://github.com/ngoldman/valis.pw)). Though it's not explicitly stated in the wiki, **this will work for *any* domain** as long as that domain's A Record is pointing at your droplet's IP. Dokku takes care of setting up the vhost for you, so once it's done building, it should *just work*.

    ## Victory Lap

  11. @ngoldman ngoldman revised this gist Nov 3, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -64,7 +64,7 @@ Choose an app you want to deploy, `cd` into the repo, and add a new remote like
    git remote add dokku [email protected]:your-app-name
    ```

    In my case I ran `git remote add valis [email protected]:pedestrian` follow by `git push valis master` to deploy a dummy application to http://pedestrian.valis.pw. It worked!
    In my case I ran `git remote add valis [email protected]:pedestrian` followed by `git push valis master` to deploy a dummy application to http://pedestrian.valis.pw. It worked!

    ## 7. Deploy an App to the root domain

  12. @ngoldman ngoldman revised this gist Nov 3, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -64,7 +64,7 @@ Choose an app you want to deploy, `cd` into the repo, and add a new remote like
    git remote add dokku [email protected]:your-app-name
    ```

    In my case I added the following remote `git remote add valis [email protected]:pedestrian` to deploy a dummy application called [pedestrian](https://github.com/ngoldman/pedestrian) to http://pedestrian.valis.pw. It worked!
    In my case I ran `git remote add valis [email protected]:pedestrian` follow by `git push valis master` to deploy a dummy application to http://pedestrian.valis.pw. It worked!

    ## 7. Deploy an App to the root domain

  13. @ngoldman ngoldman revised this gist Nov 3, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ This write up owes a great deal to [dscape](http://twitter.com/dscape)'s [Node.j

    ## 1. Get a domain

    Make sure you have a domain picked out *first*. There will be less waiting around for the DNS to resolve. I got `valis.pw` from [namecheap](http://www.namecheap.com/) for a cool 3.98/yr.
    Make sure you have a domain picked out *first*. There will be less waiting around for the DNS to resolve. I got http://valis.pw from [namecheap](http://www.namecheap.com/) for a cool 3.98/yr.

    ## 2. Create a droplet

    @@ -64,7 +64,7 @@ Choose an app you want to deploy, `cd` into the repo, and add a new remote like
    git remote add dokku [email protected]:your-app-name
    ```

    In my case I added the following remote `git remote add valis [email protected]:pedestrian` to deploy a dummy application called [pedestrian](https://github.com/ngoldman/pedestrian) to `pedestrian.valis.pw`. It worked!
    In my case I added the following remote `git remote add valis [email protected]:pedestrian` to deploy a dummy application called [pedestrian](https://github.com/ngoldman/pedestrian) to http://pedestrian.valis.pw. It worked!

    ## 7. Deploy an App to the root domain

  14. @ngoldman ngoldman revised this gist Nov 3, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -64,7 +64,7 @@ Choose an app you want to deploy, `cd` into the repo, and add a new remote like
    git remote add dokku [email protected]:your-app-name
    ```

    In my case I added the following remote `git remote add valis [email protected]:pedestrian` to deploy a dummy application called pedestrian to `pedestrian.valis.pw`. It worked!
    In my case I added the following remote `git remote add valis [email protected]:pedestrian` to deploy a dummy application called [pedestrian](https://github.com/ngoldman/pedestrian) to `pedestrian.valis.pw`. It worked!

    ## 7. Deploy an App to the root domain

    @@ -76,7 +76,7 @@ Basically all you need to do is make the part of the git address after the colon
    git remote add dokku [email protected]:your.domain
    ```

    So for my setup, I'm doing `git remote add valis [email protected]:valis.pw`. Though it's not explicitly stated in the wiki, this will work for *any* domain as long as that domain's A Record is pointing at your droplet's IP. Dokku takes care of setting up the vhost for you, so once it's done building, it should *just work*.
    So for my setup, I'm doing `git remote add valis [email protected]:valis.pw` to deploy a very basic Node.js app ([source](https://github.com/ngoldman/valis.pw)). Though it's not explicitly stated in the wiki, this will work for *any* domain as long as that domain's A Record is pointing at your droplet's IP. Dokku takes care of setting up the vhost for you, so once it's done building, it should *just work*.

    ## Victory Lap

  15. @ngoldman ngoldman revised this gist Nov 3, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    **Setting up Dokku with DigitalOcean and Namecheap**

    or how I made my own heroku in a few hours for $3.98.
    ..or how I made my own heroku in a few hours for $3.98.

    This write up owes a great deal to [dscape](http://twitter.com/dscape)'s [Node.js Deployments with Docker, Dokku, & Digital Ocean](https://medium.com/code-adventures/438bce155dcb), the [dokku](https://github.com/progrium/dokku) project itself, and the fine folks working on dokku's [issues](https://github.com/progrium/dokku/issues). I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

  16. @ngoldman ngoldman created this gist Nov 3, 2013.
    85 changes: 85 additions & 0 deletions dokku_setup.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,85 @@
    # Deploy your own PaaS!

    **Setting up Dokku with DigitalOcean and Namecheap**

    or how I made my own heroku in a few hours for $3.98.

    This write up owes a great deal to [dscape](http://twitter.com/dscape)'s [Node.js Deployments with Docker, Dokku, & Digital Ocean](https://medium.com/code-adventures/438bce155dcb), the [dokku](https://github.com/progrium/dokku) project itself, and the fine folks working on dokku's [issues](https://github.com/progrium/dokku/issues). I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

    ## 1. Get a domain

    Make sure you have a domain picked out *first*. There will be less waiting around for the DNS to resolve. I got `valis.pw` from [namecheap](http://www.namecheap.com/) for a cool 3.98/yr.

    ## 2. Create a droplet

    Sign up for DigitalOcean if you haven't already. I used a [promo code](https://twitter.com/digitalocean/status/390197040896290817) and got $10 credit, effectively getting two months for free if I keep my usage low enough to only need a 512mb instance.

    As of 2013-11-03T04:01:13.102Z dokku is having issues with Ubuntu 13.10, so go with Ubuntu 13.04 x64 unless that issue's been resolved. Make sure the droplet's hostname is the exact same as your domain (mine would be `valis.pw`), as this will ensure `/etc/hostname` and the `hostname` command respond correctly (something dokku relies on).

    ## 3. Configure DNS

    Once the droplet is up and running you should have an IP address to work with. If you're using namecheap, go to the "All Host Records" page of namecheap's "My Account > Manage Domains > Modify Domain" section.

    You'll need an A record for the naked domain (the "@" one) pointing to your IP with the lowest TTL possible (namecheap caps the minimum at 60), and a wildcard for subdomains with the same info. I'd recommend redirecting www to the naked domain.

    It should look something like this when you're done entering your data.

    | HOST NAME | IP ADDRESS/URL | RECORD TYPE | MX PREF | TTL |
    | --- | --- | --- | --- | --- |
    | @ | your.ip.address.k.thx | A (Address) | n/a | 60 |
    | www | http://your.domain | URL Redirect (301) | n/a | 60 |
    | * | your.ip.address.k.thx | A (Address) | n/a | 60 |

    ## 4. Bootstrap Dokku

    Once you get a happy response from `dig +short $HOSTNAME` (where $HOSTNAME is your hostname, e.g. `dig +short valis.pw`, and the response contains the IP address you got from Digital Ocean and set in your Host Record configuration), you should be ready to go.

    If you set up your SSH keys correctly you should be able to simply connect to the droplet via ssh without a password.

    ```sh
    ssh [email protected] # or [email protected]
    ```

    For me the command was `ssh [email protected]`. I immediately checked if `/etc/hostname` contained `valis.pw` and the `hostname` command responded in kind just to be sure.

    Once you're logged in as root, you can simply run the dokku bootstrap script.

    ```sh
    wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
    ```

    ## 5. Configure Dokku

    ```sh
    cat ~/.ssh/id_rsa.pub | ssh progriumapp.com "sudo sshcommand acl-add dokku name"
    ```

    In this case dokku is the user associated with the dokku command (already created by dokku's bootstrap.sh), so it should not be changed. The `name` parameter is the name of the SSH key you're adding (so that it can be removed later by name if necessary). `name` *should* be changed (might be a good idea to use the name you gave to the same SSH key on Digital Ocean).

    ## 6. Deploy an App to a subdomain

    Choose an app you want to deploy, `cd` into the repo, and add a new remote like so:

    ```sh
    git remote add dokku [email protected]:your-app-name
    ```

    In my case I added the following remote `git remote add valis [email protected]:pedestrian` to deploy a dummy application called pedestrian to `pedestrian.valis.pw`. It worked!

    ## 7. Deploy an App to the root domain

    This is detailed on [this page](https://github.com/progrium/dokku/wiki/Deploying-to-root-and-subdomains) of dokku's github wiki (took a little searching to actually track this down).

    Basically all you need to do is make the part of the git address after the colon the same as the root domain.

    ```sh
    git remote add dokku [email protected]:your.domain
    ```

    So for my setup, I'm doing `git remote add valis [email protected]:valis.pw`. Though it's not explicitly stated in the wiki, this will work for *any* domain as long as that domain's A Record is pointing at your droplet's IP. Dokku takes care of setting up the vhost for you, so once it's done building, it should *just work*.

    ## Victory Lap

    Feelin pretty cool right about now.

    ![](http://www.halolz.com/wp-content/uploads/2010/05/halolz-dot-com-supersmashbrosbrawl-kingdedede-feelsgoodman1.jpg)