{"id":1434,"date":"2016-03-31T09:14:10","date_gmt":"2016-03-31T13:14:10","guid":{"rendered":"http:\/\/codinggorilla.domemtech.com\/?p=1434"},"modified":"2016-04-05T05:20:55","modified_gmt":"2016-04-05T09:20:55","slug":"setting-up-dokku-via-command-line-script","status":"publish","type":"post","link":"http:\/\/165.227.223.229\/index.php\/2016\/03\/31\/setting-up-dokku-via-command-line-script\/","title":{"rendered":"Setting Up Dokku via Command-Line Script"},"content":{"rendered":"<p><a href=\"http:\/\/dokku.viewdocs.io\/dokku\/\" target=\"_blank\">Dokku<\/a> is a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Platform_as_a_service\" target=\"_blank\">PAAS<\/a> implementation, useful for websites, servers, or development. As it notes in its website, the installation in a Debian host running Bash is just three steps:<\/p>\n<pre># only works on debian systems!\r\nwget https:\/\/raw.githubusercontent.com\/dokku\/dokku\/v0.5.3\/bootstrap.sh\r\nsudo DOKKU_TAG=v0.5.3 bash bootstrap.sh\r\n# go to your server's IP and follow the web installer\r\n<\/pre>\n<p>The last &#8220;step&#8221; is written as a Bash comment. It states to complete the installation via a web browser. If you&#8217;re like me, this is a surprise, completely opposite of command-line driven provisioning. Using <a href=\"http:\/\/www.telerik.com\/fiddler\" target=\"_blank\">Fiddler<\/a>, I conjured up a script to fix this problem. Enjoy!<\/p>\n<p>(Note: <a href=\"https:\/\/github.com\/dokku\/dokku\/issues\/2056\" target=\"_blank\">I asked the question in the Dokku issue page<\/a>, and the reply pointed to using\u00c2\u00a0<a href=\"http:\/\/dokku.viewdocs.io\/dokku\/getting-started\/install\/debian\/#unattended-installation\" target=\"_blank\">debconf<\/a>. You can use that. Or, you can use this script&#8211;which I think is easier.)<\/p>\n<pre>#\r\n# Set up Dokku via command line\r\n\r\nset -e\r\n\r\nif [ \"$#\" -ne 1 ]; then\r\n echo \"Try this: cat ~\/.ssh\/id_rsa.pub | ${0##*\/} -\"\r\n exit 1\r\nfi\r\n\r\nexport IP=`ip route get 8.8.8.8 | awk '{print $NF; exit}'`\r\nexport KEY=$(&lt;\/dev\/stdin)\r\n\r\nif [ \"${KEY\/ssh-rsa}\" = \"$KEY\" ] ; then\r\n echo \"Input is not a ssh key.\"\r\n exit 1\r\nfi\r\n\r\ncurl \"http:\/\/localhost\" &gt; \/dev\/null 2&gt;&amp;1\r\n\r\nexport FKEY=`echo -ne \"$KEY\" | hexdump -v -e '\/1 \"%02x\"' | sed 's\/\\(..\\)\/%\\1\/g'`\r\n\r\ncat &lt;&lt;EOF | curl -XPOST --data @- \"http:\/\/localhost\/setup\"\r\nkeys=$FKEY&amp;hostname=$IP\r\nEOF\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dokku is a PAAS implementation, useful for websites, servers, or development. As it notes in its website, the installation in a Debian host running Bash is just three steps: # only works on debian systems! wget https:\/\/raw.githubusercontent.com\/dokku\/dokku\/v0.5.3\/bootstrap.sh sudo DOKKU_TAG=v0.5.3 bash bootstrap.sh # go to your server&#8217;s IP and follow the web installer The last &#8220;step&#8221; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/165.227.223.229\/index.php\/2016\/03\/31\/setting-up-dokku-via-command-line-script\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Setting Up Dokku via Command-Line Script&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts\/1434"}],"collection":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/comments?post=1434"}],"version-history":[{"count":0,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts\/1434\/revisions"}],"wp:attachment":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/media?parent=1434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/categories?post=1434"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/tags?post=1434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}