Put your app online with Shelly Cloud
Created by Kasia Jarmołkowicz, @_idengager
Shelly Cloud is a PaaS (Platform as a Service) hosting provider, dedicated for Ruby on Rails apps. New users get €20 worth of credit to run their applications, which is more than enough to show off your first Rails app for a couple of weeks.
Coach: For an overview of deploying to Shelly Cloud, look at the Quick Start guide.
Prepare your app for deployment
You need to change the database your app uses from SQLite to PostgreSQL and add a gem that ensures seamless deployment to Shelly Cloud. Replace the following line in your
group :development do gem 'sqlite3' end group :production do gem 'pg' gem 'shelly-dependencies' end
and then run
$ bundle install
Coach: Talk about relational databases and the differences between SQLite and PostgreSQL.
Initialize your git repository
When your repo is all set, use
git commit to save your changes.
$ git add . $ git commit -m 'Replace sqlite with postgres, add shelly-dependencies gem'
Coach: Explain the importance of helpful commit messages.
Sign up for Shelly Cloud
You can sign up for Shelly Cloud using the sign-up form. Clicking on the link in the confirmation email will complete your sign-up process. You can now install the
$ gem install shelly
shelly login to log in:
$ shelly login Email (firstname.lastname@example.org - default): [enter your email] Password: [enter your password] Login successful Uploading your public SSH key
shelly gem will look for a public SSH key in your
~/.ssh directory, choosing either a DSA key
id_dsa.pub or a RSA key
id_rsa.pub. If you’re not sure if you have a SSH key already, take a look at this helpful Github article.
Create your cloud
All the information needed for your app to work with Shelly Cloud will be stored in the
Cloudfile, a little file that should be placed in your app main directory. We can generate a default
Cloudfile, which will fit our needs perfectly, using the
Tip: If you need a specific Ruby version or want to use a different database, check the Cloudfile documentation to help you set it up.
You are now ready to create your cloud! Make sure you’re in your app directory, type
shelly add and follow the instructions.
$ cd ~/your-app $ shelly add -c [enter the name of your cloud]
You should commit your
Cloudfile, too, with an appropriate commit message.
$ git add Cloudfile $ git commit -m 'Add Cloudfile'
Push to production
You put your app in the cloud using
$ git push shelly master ---> Received push to cloud 'your-cloud-name' ---> Checking Gemfile ---> Creating code package... done. ---> Push accepted ---> Start your cloud using: `shelly start --cloud your-cloud-name`
You can now start your app.
$ shelly start --cloud your-cloud-name Starting cloud your-cloud-name. ---> Launching server app1 started ---> Launching server app1 finished ---> Configuration on server app1 started ---> Configuration on server app1 finished ---> Deployment on server app1 started ---> Deployment on server app1 finished Starting cloud successful
Tip: If you make changes to your app, you can just commit them and use
git push shelly master to redeploy.
Your app is now live at http://your-cloud-name.shellyapp.com. Share it with the world and keep coding!