Contact Us

Ruby on Rails for Startups – deploy your apps on Vultr with Cloud 66

Ruby on Rails | July 8, 2021

Ruby on Rails is one of the first choices to build applications by startups and small businesses across different sectors. In this article, we will answer the following questions: What are the benefits of using the Rails framework? How do Vultr and Cloud 66 support small businesses? How do you deploy a Rails application to Vultr with Cloud 66, step-by-step?

Why do startups choose Ruby on Rails?

There are several good reasons why successful companies like Airbnb, Shopify, Hulu, or GitHub run on Rails. You can find more about it in the 50 Best Ruby On Rails Companies Websites [State For 2021]. Here are the top benefits of Rails applications for your startups.

  • It’s an established framework that has been around since 2003.
  • Rails is time-efficient, which is valuable, especially to small startup teams. It contains a range of ready-made plugins and modules. Plus it’s based on a Model–View–Controller design pattern that supports rapid project development. This allows for up to 40% faster development compared to other similar frameworks.
  • It’s an open-source framework, which solves one of the most common startup problems – a constrained budget.
  • Ruby on Rails has a strong, friendly, and active community behind it, with nearly 5K people contributing to Rails code. So not only can you rely on support from the community, but you also know that it is safe to bet on Rails, even though it is open-source.
  • The Rails community keeps the Rails framework up to date and it ensures that any new plugins or features are tested before releases. With a secure development life-cycle Rails creates a safe environment for startups.
  • The ultimate goal of every startup is to grow, gaining more traffic and customers. Rails is a great choice for scaling your application. By dividing your application into functional blocks you will be able to scale horizontally.
  • Competition is strong in nearly every industry therefore a high-quality application helps to win the customers. Rails is championing bug-free and test-driven development that ensures software quality.
  • End-to-end: It covers the full stack (front and back-end design).

Why do startups choose Vultr?

Vultr was created by veterans of the managed hosting businesses with a ton of experience. The Vultr team is determined to deliver a platform that is friendly and easy to use, with low and controlled pricing that fits the startup environment well. Startups choose Vultr as their cloud provider because, Vultr offers:

  • 16 strategically placed regions, that would allow you to launch a cloud environment close to you and your customers.
  • Full resource control. Local root and out-of-band console access are provided on all compute instances.
  • No vendor lock-in and no contract, with a simple, hourly, pay-as-you-go pricing model.

Why do startups choose Cloud 66?

We’ve been helping startups around the world to run their infrastructure since 2012. As alumni of the Techstars accelerator program, we understand the challenges of launching and scaling a new company. We champion and care a lot about our customers’ projects.

Cloud 66 for Rails simplifies DevOps for developers by offering Heroku-like functionality on any cloud provider, including Vultr. It helps developers to deploy, manage and scale Rails applications, so you can focus on writing great code while we will take care of your infrastructure.

There is no vendor lock-in, and we offer 4 weeks of free trial, with no credit card requirements so you can fully experience how Cloud 66 fits your infrastructure. After that, we charge $14.99 per server per month, with a pay-as-you-go model.

What do you need to deploy your Rails app with Cloud 66 to Vultr?

Before we move on to Rails deployments, please make sure that you have access to the following.

  • A Vultr account
  • A Cloud 66 account

Step 1 – Commit your Rails application to a git repo

Cloud 66 allows you to use any git provider, public or private e.g. GitHub, BitBucket, Assembla, or use your own privately hosted repo. For private git repos, you’ll need to add and approve the Cloud 66 public SSH key with your git provider.

If you are new to Rails have a look at the Ruby on Rails Getting Started guide, to create your first Rails app from scratch. Additionally, have a look at the PostgreSQL or MySQL guides to help you set up the database for your application.

Step 2 – Create a Vultr account

Before you create your Vultr account think about the right server size for your application. Consider that Ruby on Rails applications need quite a lot of RAM and think about your database size. Also, allow some space for components like Redis, backend workers or ElasticSearch.

Now, visit the Vultr site, and click on the Signup button. Create your account with your email address and password.

Once completed, it will take you directly to the payment page. Vultr allows you to pay via Credit Card, Paypal, Bitcoin, or Alipay.

Enter your details and choose the amount you would like to spend. Or tick the box ‘I just want to link my credit card -$0.00 deposit’ if you want to explore it before any commitments.

Step 3 – Create your Cloud 66 account

Sign up for a Cloud 66 account with your GitHub or Google account, or simply use your email and create a password. We offer free unlimited access to all products for 4 weeks with no credit card required.

Next, select the product that you would like to use. For the purpose of this guide select Cloud 66 for Rails by clicking on the Get Started button on the “I have a Native Ruby App” option and follow that route.

Connect Git and Vultr with Cloud 66

First, connect Git:

Now we are going to connect all 3 accounts together via the Cloud 66 dashboard. As we already have all 3 accounts ready this will not take long.

Start by connecting your Git repo with your Cloud 66 account. You can link Cloud 66 with your GitHub account with the click of the button “Link with my GitHub account”

In the next box, fill in the info about your application deployment. You can use Git URL to your own application or use our Rails sample:https://github.com/cloud66-samples/rails-mysql.

Once you click on the “Link with my GitHub account” button the dashboard will take you to the next page to authorize Cloud 66 access to your code.

When you are ready, click on the Analyze button and Cloud 66 will pull your code from your repository and analyse your application. We return all the information we have found about your application.

For example, we know that our Rails sample has Ruby (v.2.7.2) and Rails (v.6.0.3.2) versions. It contains Phusion Passenger as a packet manager, MySQL for a database and production environment.

Note: You can always change or add anything to your code at any time during this stage of the process. The code is yours and you always have full control. After any changes just click on the”Reanalyse my Code” button so we know about the changes and can update your app.

Next, add Vultr:

Now click the Add Deployment Target button. Because Cloud 66 is natively integrated with Vultr, you can just select Vultr from the drop-down and add your Vultr API Key to confirm access.

Note: If you are not sure where to find Vultr API Key, then go to this URL.

Next, select your server region and server size.

Cloud 66 Dashboard: Fill in Vultr deployment details server, region, and size. 

Lastly, we will ask you about deployment details for your Database. As we are using a sample project we can safely share the server with the database. However, we would recommend selecting a separate server for your database for production environments.

Deploy Rails application on Vultr with Cloud 66

We are ready to go! You have created and connected all three accounts and now it’s time to deploy your app. Click on the Deploy Application button.

Sit back, relax and watch the deployment. The deployment time depends on your application size. You can have a look at our deploy LiveLogs to see what is happening under the bonnet, but if you are not interested you can close the window. We will email you once the deployment is completed.

Congratulations your Rails application was successfully deployed to Vultr cloud! Have a look at our dashboard and take advantage of other Cloud 66 features to manage and scale your application.

A quick overview of the menu functions:

  • Overview – allows you to monitor your application components in the dashboard. You can click on each server, e.g. ‘Rails Servers’ for more detailed info.
  • Deployments show you a timeline of your deployments. Who deploys what and when? You can view when all the code commits were deployed here.
  • Clone your application: you can clone your application with a click of the button. You can change the deployment destination to a different region as needed.

Additionally, have a look at our Pro Tip guides to improve your stack score. Or simply click on your stack score icon “F”. It will take you to a new page and show you what you can do to optimize your application. It will suggest improvements e.g. creating a backup, adding load balancer, creating a failover group, etc.

Deploy any application on Vultr with Maestro

If you are looking to deploy application types other than Ruby on Rails, check out Cloud 66 Maestro:

  • It’s a full container management service.
  • It builds a Kubernetes cluster on your servers.
  • It builds your code into Docker images.
  • It takes care of databases, firewalls, and networking for your applications on any cloud.
  • It’s a great way to deploy any application (any language, any framework) that has a Dockerfile.

To see Maestro in action have a look at our guide on How to deploy a Node.js app to the Kubernetes cluster on Vultr. The application can be written in any language or framework. You can also see Maestro deployments on Vultr in our 2 min demo:

I would like to sum up with the DHH quote ‘Optimizing for happiness is perhaps the most formative key to Ruby on Rails’ – so Deploy Happy with Cloud 66 on Vultr!

This content was originally published here.