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.
This guide assumes you followed through with your first Rails app guide. If you get stuck at any point in this tutorial, take a look at the docs or use one of our support channels.
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 Gemfile
:
with:
and then run bundle install
.
Coach: Talk about relational databases and the differences between SQLite and PostgreSQL.
Initialize your git repository
You should now commit the changes to your git repository. If you haven’t initialized one yet, take a look at this Github Rails Girls guide or use the Github’s docs directly.
When your repo is all set, use git commit
to save your changes.
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 shelly
gem:
and type shelly login
to log in:
Tip: The 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 shelly
gem.
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.
You should commit your Cloudfile
, too, with an appropriate commit message.
Push to production
You put your app in the cloud using git push
.
You can now start your app.
Tip: If you make changes to your app, you can just commit them and use git push shelly master
to redeploy.
Celebrate!
Your app is now live at http://your-cloud-name.shellyapp.com. Share it with the world and keep coding!