Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to correctly install dokku - with or without sudo?

Tags:

dokku

I'm learning dokku right now for simple web deployment. Offical install instructions state this command:

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

I'm not a devop or admin, but as far as I understand this line, it performs all bootstrapping and installation under the root account, thanks to sudo. So dokku will be checked out into a directory with root access rights, and all additional directories like /var/lib/dokku/ will also have root access rights.

The problem is - all articles across the internet about dokku instructs to execute dokku command or do dokku-related actions without sudo. For example, instructions about this dokku database plugin, https://github.com/krisrang/dokku-mariadb, instructs to install it via:

cd /var/lib/dokku/plugins
git clone https://github.com/krisrang/dokku-mariadb mariadb
dokku plugins-install

This is not working, since /var/lib/dokku/plugins have root access rights and git clone will fail with acces denied. It's hard to be a non-admin nowadays, but maybe someone will hint what I'm doing wrong? Do I need to install dokku some other way, or all dokku-related tutorials across internet assume that I'm executing them under root (which is, by my limited admin knowledge, highly not recommended for security reasons).

like image 544
grigoryvp Avatar asked Jan 10 '15 07:01

grigoryvp


1 Answers

You should run those three commands as sudo:

sudo su -

The dokku binary will run code as the dokku user even if you execute as root. So it should be fine to run that as is. Once you are the sudo user, just run the install instructions listed in your question. Hope my answer helps ! :)

I also contacted them as they mentioned:

In the future, we'll have a method to install plugins directly with a dokku command

like image 141
Heisenberg Avatar answered Oct 06 '22 02:10

Heisenberg