Files
dokku/docs/installation.md
Jose Diaz-Gonzalez 155f4e9aba Release 0.3.8
2014-12-08 22:14:03 -05:00

5.2 KiB

Installation

Requirements

  • A fresh VM running Ubuntu 14.04 x64

Ubuntu 14.04 x64 x64. Ideally have a domain ready to point to your host. It's designed for and is probably best to use a fresh VM. The bootstrapper will install everything it needs.

Installing the latest Stable version

To install the latest stable version of dokku, you can run the following bootstrapper command:

wget -qO- https://raw.github.com/progrium/dokku/v0.3.8/bootstrap.sh | sudo DOKKU_TAG=v0.3.8 bash

Configuring

Set up a domain and a wildcard domain pointing to that host. Make sure /home/dokku/VHOST is set to this domain. By default it's set to whatever hostname the host has. This file is only created if the hostname can be resolved by dig (dig +short $(hostname -f)). Otherwise you have to create the file manually and set it to your preferred domain. If this file still is not present when you push your app, dokku will publish the app with a port number (i.e. http://example.com:49154 - note the missing subdomain).

You'll have to add a public key associated with a username by doing something like this from your local machine:

$ cat ~/.ssh/id_rsa.pub | ssh dokku.me "sudo sshcommand acl-add dokku $USER"

That's it!

Advanced installation

Development via bash script

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

This may take around 5 minutes. Certainly better than the several hours it takes to bootstrap Cloud Foundry.

You may also wish to take a look at the advanced installation document for additional installation options.

Development From Source

If you plan on developing dokku, the easiest way to install from your own repository is cloning the repository and calling the install script. Example:

git clone https://github.com/yourusername/dokku.git
cd dokku
sudo make install

The Makefile allows source URLs to be overridden to include customizations from your own repositories. The DOCKER_URL, PLUGINHOOK_URL, SSHCOMMAND_URL and STACK_URL environment variables may be set to override the defaults (see the Makefile for how these apply). Example:

sudo SSHCOMMAND_URL=https://raw.github.com/yourusername/sshcommand/master/sshcommand make install

Bootstrap a server from your own repository

The bootstrap script allows the dokku repository URL to be overridden to bootstrap a host from your own clone of dokku using the DOKKU_REPO environment variable. Example:

wget https://raw.github.com/progrium/dokku/master/bootstrap.sh
chmod +x bootstrap.sh
sudo DOKKU_REPO=https://github.com/yourusername/dokku.git ./bootstrap.sh

Custom buildstep build

Dokku ships with a pre-built version of the buildstep component by default. If you want to build your own version you can specify that with an env variable.

git clone https://github.com/progrium/dokku.git
cd dokku
sudo BUILD_STACK=true make install

Install Dokku using Vagrant

  • Download and install VirtualBox

  • Download and install Vagrant

  • Clone Dokku

    git clone https://github.com/progrium/dokku.git
    
  • Setup SSH hosts in your /etc/hosts

    10.0.0.2 dokku.me
    
  • Setup SSH Config in ~/.ssh/config

    Host dokku.me
        Port 2222
    
  • Create VM

    # Optional ENV arguments:
    # - `BOX_NAME`
    # - `BOX_URI`
    # - `BOX_MEMORY`
    # - `DOKKU_DOMAIN`
    # - `DOKKU_IP`.
    cd path/to/dokku
    vagrant up
    
  • Copy your SSH key via cat ~/.ssh/id_rsa.pub | pbcopy and paste it into the dokku-installer at http://dokku.me . Change the Hostname field on the Dokku Setup screen to your domain and then check the box that says Use virtualhost naming. Then click Finish Setup to install your key. You'll be directed to application deployment instructions from here.

You are now ready to deploy an app or install plugins.

For a different, complete, example see https://github.com/RyanBalfanz/dokku-vagrant-example.

Installing on Linode

Using StackScript

Deploy using the following StackScript:

Without StackScript