Skip to content

Instantly share code, notes, and snippets.

@colindensem
Forked from glinton/aProxy.md
Created July 26, 2017 22:11
Show Gist options
  • Save colindensem/eef1dd1be280f77cac1bd1e7af972a7f to your computer and use it in GitHub Desktop.
Save colindensem/eef1dd1be280f77cac1bd1e7af972a7f to your computer and use it in GitHub Desktop.
Install and use nanobox on a linux cloud box (or about any other linux box). Tested on DigitalOcean 16.04
# become root (if not already)
sudo su
# create user 'nanouser' with password 'password'
useradd -m -p papAq5PwY/QQM -s /bin/bash nanouser
# make 'nanouser' a sudoer
usermod -aG sudo nanouser
# get docker
curl -fsSL https://get.docker.com/ | sh
# add 'nanouser' to docker group
usermod -aG docker nanouser
# create some directories
mkdir -p /home/nanouser/Downloads/nano
mkdir /home/nanouser/bin
# download and extract the installer (technically it should be downloaded after logging into the dashboard, but it is open source). Re-run to upgrade
curl https://d1ormdui8qdvue.cloudfront.net/installers/v2/linux/nanobox-2.tar.gz | tar -C /home/nanouser/Downloads/nano -zxf -
# link required binaries to `bin` path
ln -sf /home/nanouser/Downloads/nano/usr/local/bin/nanobox /home/nanouser/bin/nanobox
ln -sf /home/nanouser/Downloads/nano/usr/local/bin/nanobox-machine /home/nanouser/bin/nanobox-machine
ln -sf /home/nanouser/Downloads/nano/usr/local/bin/nanobox-vpn /home/nanouser/bin/nanobox-vpn
# add `bin` to path
echo 'export PATH=$PATH:/home/nanouser/bin' >> /home/nanouser/.bashrc
# enable swap for larger codebases
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
# login as nanouser
su - nanouser
# clone your application (best to login via `ssh -A`)
git clone https://github.com/nanobox-quickstarts/nanobox-rails.git && cd nanobox-rails
# run the nanobox!
nanobox run
# will have prompts for install and request login to nanobox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment