Getting started with the Ruby on Rails InstantApp | Scaleway


Getting started with the Ruby on Rails InstantApp

The intended audience of this image is Rails developers who want to bootstrap or test a Rails application easily, in seconds.

Common packages have been installed:

  • Nginx
  • Ruby
  • RVM
  • Rails
  • Unicorn
  • Node.js


  • You have an account and are logged into
  • You have configured your SSH Key

Step 1 - Create and start a new C1 server using the Ruby on Rails InstantApp

First, we need to create a new server using the Ruby on Rails InstantApp. Click on “Create Server” button in the control panel.

You land on the server creation page where you must input information and choose an image.

After inputting your server basic information, select the Ruby on Rails image for your server. On the ImageHub tab, select Ruby on Rails and click the “Create Server” button.

In a few seconds, the server will be started.

Step 2 - Run a Ruby on Rails web application

Log-in to your server with the following command:

$> ssh  -i /path/to/key root@<your_server_ip>

Once connected to the server, log-in as rails user:

$> su rails
$> source /etc/profile

In the home directory of rails user /home/rails, you will find the default directory containing a fresh rails application. You can use it to bootstrap your rails project.

Unicorn is configured to serve the default Rails application in /home/rails/default.

You can access the Rails application via your browser at http://your_server_ip to view the default app website!

If you want to create a new Rails application, you will have to perform some actions to get it running with unicorn:

Create a new Rail application

$> rails new yourapplicationname


$> rake -f /home/rails/yourapplicationame/Rakefile secret

Edit Unicorn configuration

Open the file /etc/default/unicorn to change the working directory and SECRET_KEY_BASE.

Set application working directory to APP_ROOT=/home/rails/yourapplicationame and SECRET_KEY_BASE value to the key generated previously.

Then in /etc/unicorn.conf change the working_directory value to /home/rails/yourapplicationame.

Restart Unicorn as root user and you can open your browser and visit your IP to view your super new application!

$> service unicorn restart


Useful links:

This image doesn’t contain databases, because we can’t really know which one you prefer.

To install MySQL, run:

$> apt-get install mysql-server

And/or PostgreSQL:

$> apt-get install postgresql


If you think something is missing in this image, or if it would have been easier if you had this or that tool, or if thisshould be configured that way instead of how it currently is, we'd love to hear from you!

You can make an issue and/or a pull request on github

Try this tutorial on your own C1 server TRY IT

This is a companion discussion topic for the original entry at

I think this is broken. I get a 502 bad gateway when I try to visit the app at the IP I am prompted with who I SSH into the server.


I get 502 here too. It seems to be broken indeed.


It seems that unicorn doesn’t start by default when you launch the instance.

service unicorn start

did the trick.


Merci pour cette petite explication, des fois je me plante et ton info est assez intéressante pour moi.