Running BaasBox 0.9.4 on Ubuntu 14.04

This is a simple guide to getting BaasBox up and running on Ubuntu. I’m running it on a vps on digital ocean. Right now this is purely for a dev environment and you shouldn’t expect to use the setup for a production site.

First we get our dependencies installed:

# Install Java, Supervisor, and unzip
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer unzip supervisor

Next setup an account to run BaasBox

# Add baasbox user and set up directories
sudo adduser baasbox
sudo -u baasbox
sudo mkdir -p /opt/baasbox
sudo mkdir -p /var/log/baasbox

We’ll download the latest verison (0.9.4) of BaasBox and symlink it which will be helpful for later upgrades.

# Download Baasbox
cd /opt
wget --content-disposition
sudo chown -R baasbox /var/log/baasbox /opt/baasbox-*
ln -s baasbox-0.9.4 baasbox

We’re going to make a couple small changes to the default start script. This will allow us to use a config file for our server and application options, it will also allow us to run BaasBox as a daemon in the next step.
Replace /opt/baasbox/start with the following script:

Finally create the server config file at /opt/baasbox/baasbox.conf

We’ll use supervisord, which we installed in the first step to run BaasBox as a service. Supervisord will be responsible for automatically running BaasBox if the process dies or if the machine is rebooted.

# Set up supervisor
service supervisor restart


Create a config file in /etc/supervisor/conf.d/baasbox.conf

Now you should be up and running with BaasBox on port 9000. Remember this is only acceptable for development and please replace the default appcode and admin password.

Swift Playgrounds and 3rd Party Dependencies

Recently, I have been teaching myself swift and exploring 3rd party libraries. It seemed like playgrounds would be the natural way to do this, but I have spent hours trying to figure out how to make it work. My breakthrough finally came when I found this stackoverflow answer explaining the requirements. Immediately after that I found the Apple documentation for the same thing. Of course, the explanations outlined what needed to happen to use external frameworks but didn’t explain how to make it work. With an evening of project creation I was finally able to get something in a working state using cocoapods. This post assumes you have used cocoapods and have it installed in order to proceed.

In XCode do the following:

File -> New -> Project
Single View -> Next
Name: ProjectWithDependencies
Choose a location and click create.

Now run the project. I DON’T KNOW WHY, but without this step the workspace is not correctly configured.

File -> File -> iOS -> Playground
Name: PlaygroundWithDependencies
The default location and options are fine, click create

You now have a project, containing a generic single view application. You also have a playground which says “hello world”.

Now close XCode, open your terminal, and cd to the ProjectWithDependencies directory. For this post we’ll be pulling in Alamofire and Argo to our playground. To do this we will create a cocoapods project.

pod init // create a Podfile

Now edit the Podfile to include our dependencies.

# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'


pod 'Alamofire'
pod 'Argo'

target 'PlaygroundWithDependencies' do


target 'PlaygroundWithDependenciesTests' do


Finally (make sure XCode is closed) and run:

pod install
open ProjectWithDependencies.xcworkspace

The last command line step is to actually run pod install to generate the workspace file and pull down the dependencies we just specified.

When we open the workspace the natural thought is to open the Playground and import the new libraries, however, if you do this you’ll see that the project does not recognize them. The final prerequisite is to build the new frameworks. Click and hold on the scheme for ‘ProjectWithDependencies’ in XCode and select ‘Manage Schemes…’

glorious xcode

From there select the check boxes for the Pods we will want to import. For each one choose the scheme and build with the run button or with CMD+R. You must do this for each Pod you with to import. In this case Pods-Alamofire and Pods-Argo

Finally open the playground file itself you can now import Argo and Alamofire without error.

In case you are struggling to follow my steps the final workspace is on github.