Shelly Cloud will shut down on March 31, 2016. All services you use will be operational until then. Read our announcement.
Please remember to turn off your cloud as soon as you finish migration (remember to remove your private IP endpoints too).
We don't want to charge you for redundant resources.
December 13, 2013

Deploying Refinery CMS in a few easy steps

Refinery is totally free open source content management system. Today I'll demonstrate how to deploy it on Shelly Cloud.


Before moving on to Refinery, first make sure you have the required system tools installed:

  • Ruby, version 1.9.3 or higher. On Shelly Cloud default Ruby version is 2.0.0 and it's generally better to have the same version locally.
  • Working compiler (to install gems with native extensions)
    • on OS X you will need XCode with command line tools
    • for Ubuntu install at least build-essential and autoconf packages
  • PostgreSQL headers
    • for OS X install postgresql via
    • for Ubuntu it will be required to have libpq-dev installed

Microsoft Windows isn't supported. We strongly discourage trying this walkthrough on operating systems different than OS X or Linux.

As for gems, you will need to install:

  • Shelly
  • RefineryCMS - it’s used to generate drafts of your future application
  • ExecJS - it isn’t installed with Refinery gem but it’s required

You can do it by executing following command gem install shelly execjs refinerycms.

Step by step installation guide

  1. If you don't have a Shelly Cloud account yet use our sign up page to create one.

  2. Login to Shelly Cloud via command line.

   $ shelly login
   Email ( - default): [enter your email]
   Password: [enter your password]
   Login successful
   Uploading your public SSH key
  1. Now, we'll create our refinery-with-shelly application scaffold.
   $ refinerycms refinery-with-shelly
   Now you can launch your webserver using:

   cd refinery-with-shelly
   rails server

   This will launch the built-in webserver at port 3000.
   You can now see Refinery running in your browser at http://localhost:3000/refinery

   Thanks for installing Refinery CMS, we hope you enjoy crafting your application!
  1. Go to refinery-with-shelly directory:
   $ cd refinery-with-shelly
  1. Edit Gemfile and add :production group to the end of file.
   group :production do
     gem "shelly-dependencies"
     gem "pg"

Added gems are standard shelly dependencies for Rails application with PostgreSQL database.

  1. To have assets working it’s required to use Shelly Cloud deployment hook support

a. First, update your environment configuration (usually config/environments/production.rb) with following line:

  # Enable serving assets, use far-future expiry header
  config.static_cache_control = "public, max-age=31536000"

b. Create three hook files which will set up sharing assets between virtual servers after precompilation.

  # config/deploy/shelly/link_assets_from_disk

  set -e

  # Link public/assets to disk/assets if needed
  if [ ! -L "public/assets" ]; then
      if [ -d "public/assets" ]; then
        rmdir public/assets
      mkdir -p disk/assets
      ln -s ../disk/assets public/assets

  # config/deploy/shelly/before_migrate

  set -e

  # Make sure that public/assets is linked to disk/assets

  # Precompile assets (this happens only on one of the servers)
  rake assets:precompile

  # config/deploy/shelly/before_restart

  set -e

  # Make sure that public/assets is linked to disk/assets

c. Add execute permission for link_assets_from_disk

  $ chmod +x config/deploy/shelly/link_assets_from_disk
  1. Now run bundle install.

  2. Test the application in local environement.

a. Precompile static assets.

  $ rake assets:precompile

b. Add public/assets to .gitignore file. We don't want to have all these files commited to the repository.

c. Run migrations

  $ RAILS_ENV="production" rake db:migrate

d. Run application

  $ rails s -e production

e. You can see it by entering http://localhost:3000/refinery in your browser. You can stop your local Rails server using CTRL+C.

  1. Initialize git repository and add all files to it.
   $ git init
   $ git add .
   $ git commit -m "Initial commit of my Refinery instance"
  1. Create an application on Shelly Cloud (you can respond to all questions with the default action).

    $ shelly add
    $ git add Cloudfile
    $ git commit -m "Add application to Shelly Cloud"
    $ git push shelly master
  2. Start the newly created cloud

    $ shelly start
  3. Go to and create a first account.

    Account Creation Welcome Page

  4. Next you can continue with refinery guides.

We encourage you to try ShellyCloud with RefineryCMS by yourself. It's really simple!

Posted by D3eadd8e8a8ab3db2fd6b032a67903e9?s=22& Szymon Szypulski

Read one of our other articles - Deploying Spree on Shelly Cloud