Running Nanobox on Solus Linux

Managing the servers that your application(s) run on is enjoyable to some. I’ve automated server provisioning, deployments, backups, etc. using Ansible but it’s not enjoyable in the same way as building applications. From reading Start Small, Stay Small: A Developer’s Guide to Launching a Startup, I learned that tasks which can be outsourced, should be outsourced. Can you manage the infrastructure? Sure, but then you won’t be creating value within your application. Enter Nanobox

Nanobox is a service that manages your servers, from local dev environments to autoscaling your application(s). They utilize your cloud account from companies like Digital Ocean and Linode, which means you own your infrastructure. This post covers installation of the desktop client on Solus Linux so you can setup a local dev environment. The desktop client will utilize Docker to run container images as this is what is recommended from Nanobox for Linux. If you have not tried Solus Linux, I highly suggest it.

Setup

Download the desktop client

You must sign up for an account before downloading the desktop client. Once you have signed up, you can follow the Download Nanobox Desktop link from the dashboard or click here to go to the download page directly.

Select the .tar (General) format, as there are not native Solus packages.

Download Page

Extract the files

The Nanobox binaries will be placed in /usr/local/bin which needs to be created. The files are then extracted to their new home.

$ sudo mkdir -p /usr/local/bin

$ sudo tar -zxvf nanobox-2.tar.gz -C /usr/local/bin --strip-components=3

Install docker

Docker is a requirement for Nanobox, and is available via the package manager.

$ sudo eopkg install docker

The current user must be added to the docker group.

$ sudo usermod -aG docker username

Now logout, and log back in.

Ensure the docker group is listed when you print the groups your user is in.

$ groups
username dialout audio video cdrom lpadmin sudo fuse docker

Start Docker

By default the Docker service is not started. This will cause Nanobox to report Docker not being installed. The service must be running if you want to use the Nanobox desktop client.

$ sudo systemctl start docker

Make sure you can run docker ps

$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED
STATUS              PORTS               NAMES

Configure Nanobox

The final step in the installation is to configure Nanobox to use Docker Native, option b.

$ nanobox configure

CONFIGURE NANOBOX
---------------------------------------------------------------
Please answer the following questions so we can customize your
nanobox configuration. Feel free to update your config at any
time by running: 'nanobox configure'

(Learn more at : https://docs.nanobox.io/local-config/configure-nanobox/)

How would you like to run nanobox?
  a) Inside a lightweight VM
  b) Via Docker Native

  Note : Mac users, we strongly recommend choosing (a) until Docker Native
         resolves an issue causing slow speeds : http://bit.ly/2jYFfWQ

Answer: b

      **
   *********
***************   [√] Nanobox successfully Configured!
:: ********* ::   ------------------------------------------------------------
" ::: *** ::: "   Change these settings at any time via : 'nanobox configure'
  ""  :::  ""
    "" " ""
       "

Running nanobox will ask for your login details, and then you can begin setting up your boxfile.yml to meet your needs. To find out more about the next steps, visit the Nanobox Docs or Language Specific Guides.

If you wanted to get started quickly with a Phoenix project, checkout the Phoenix from Scratch page.

Nanobox Slack Channel

If you have issues with Nanobox, the developers are happy to help via their Slack channel. Previously I asked them to describe the security setup for the servers, and the detail they provided was excellent. While writing this blog post I joined the channel to ask about Nanobox desktop reporting Docker is not installed. They helped to identify that I forgot to start the service facepalm.