← All Articles

Easy scalable Ruby on Rails deployments using Vultr, Scaleway, Gridscale, Exoscale and many others using Cloud 66

Daniël van GilsDaniël van Gils
Oct 24th 17Updated Jul 6th 22
Ruby on Rails

easy-ruby-on-rails-deployment-on-any-cloud
Today we are going to show you how to deploy to your Ruby on Rails application using Registered Servers feature.

We take you by the hand to deploy a Ruby on Rails project under 5 minutes including load balancing, Let's Encrypt SSL and all the cool feature we support.

As you might know, we integrate with all the major cloud providers and we love it. A lot of our customers, due to legislation or other legal issues, need to deploy their applications on servers which are running physically in their own country and also owned and operated by local companies or just want to cut costs.

Also, Hybrid infrastructure is supported using registered servers. Meaning you deploy to a public cloud and running some heavy Sidekiq jobs on bare metal using registered servers.

With Registered Servers we make this happen and you get more freedom which cloud provider to choose.

What? Registered Servers?

Registered Servers are essentially a pool of your own servers in your own rack or provisioned by a public cloud provider that can be used for any stack and configuration.

Stacks can be deployed across a hybrid of cloud and registered servers, in this way you could have a dedicated server for your database and burst cloud servers for your front end.

Bring them to Cloud 66

Great , let get rolling!

To get started you need a Cloud 66 account and some running VM or bare-metal instances of your provider of choice. We already wrote a couple tutorials using some well-known cloud provider:

As long as your server obey this simples rules, you are good to go!

  • We currently only support Ubuntu 16.04 and it needs to be freshly installed on your server.
  • For security reasons, Cloud 66 only connects to your server using your secure keys on port 22.
  • As Cloud 66 connects to your server and provisions applications from scratch, administrator permissions are sometimes necessary. Therefore our script creates a new user to use for deployment that is a member of the sudoers group and that does not require a password to invoke sudo.
  • We currently only support Bourne-again shell ( Bash ). The error sh: n: source: not found during deployment may arise if you are not using the Bash shell.
  • We currently only support deploying to 64bit CPU architectures.

Now it's time to log into your Cloud 66 account. Before we create a Ruby on Rails project, make sure we put our new servers into our inventory.

Go to the Register Server panel and you find a command to run on each server to bring them on board.

alt

SSH to each server and run the register server command

~$ ssh root@xxx.xxx.xxx.xxx

Register the server

Run the Cloud 66 register server command (of course change the xxx to the value you found in your register server panel)
root@cloud66railsnode2:~# curl -s https://app.cloud66.com/server/xxx/register_script.sh | bash -s

When the command is executed, you see the following message.

alt

Approve the servers

Your servers will show up automatically in the Cloud 66 UI. Approve them to add them to the server inventory.

alt

You can also tag the server to make them easy findable if you deploy a stack.

alt

Deploy your Ruby on Rails application

Deploying a Ruby on Rails application using Registered servers works the same way using a supported public cloud.

  • Pop in your Git repository.

easy-ruby-on-rails-deployment-on-any-cloud

  • We analyse it.

easy-ruby-on-rails-deployment-on-any-cloud

  • You select the target infrastructure.
  • In this example, we use a hybrid deployment, our application server is using a registered server and our database is deployed to DigitalOcean.

easy-ruby-on-rails-deployment-on-any-cloud

  • Hit deploy.

Sit back and let us do the heavy lifting deploying your Ruby on Rails application.

After you stack is deployed you can scale your application servers, process servers or add a load balancer to handle more load. Of course you can select one of your registered server(s) or add a public cloud VM to the mix.

easy-ruby-on-rails-deployment-on-any-cloud

It's good to know when using a load balancer, using a registered server, we provision the server using HAProxy and it supports SSL termination and Let's Encrypt!

Happy Rails on Rails deployment to any server. Focus on adding value to your Rails application and let Cloud 66 handly your Ops pain.


Try Cloud 66 for Free, No credit card required