# How to Install Ruby on Rails on Ubuntu 20.04 with RVM

> URL: https://www.atlantic.net/vps-hosting/how-to-install-ruby-rails-ubuntu-20-04-rvm/ | Published: 2015-04-10 | Updated: 2024-10-21 | Author: Atlantic.Net NOC

##### Verified and tested 06/01/21

### Introduction

Installing Rails in Ubuntu has gotten much more accessible in recent days. The easiest way to do this is via installing RVM (Ruby Version Manager).

![Ruby on Rails by Walker Cahall http://www.waltronic.net/](https://www.atlantic.net/wp-content/uploads/2018/01/RAILSv1-01.png)
 *Ruby on Rails by [Walker Cahall ](http://www.waltronic.net/)*

## Install Required Dependency

First, you will need to install some dependencies on your server. You can install all of them with the following command:

```
apt-get install gnupg2 curl wget -y
```

Once all the packages are installed, you can proceed to the next step.

## Installing Rails on Ubuntu

In this section, we will show you how to install Ruby on Rails with RVM.

First, download and add the GPG key with the following command:

```
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
```

Next, install the RVM with the following command:

```
curl -sSL https://get.rvm.io | bash -s stable
```

Next, activate the RVM using the following command:

```
source /usr/local/rvm/scripts/rvm
```

Next, install the latest stable version of Ruby with the following command:

```
rvm install 3.0.1
```

Next, set the Ruby version as the default version:

```
rvm use 3.0.1 --default
```

Next, verify the installed version of Ruby with the following command:

```
ruby -v
```

Output:

```
ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
```

Next, install the bundler with the following command:

```
gem install bundler
```

Next, install the Rails using the gem command:

```
gem install rails
```

Once the Rails is installed, verify the installed version of Rails with the following command:

```
rails -v
```

You should get the following output:

```
Rails 6.1.3.2
```

Congratulations! You should now have rails installed on your ubuntu server.

Learn more about our [VPS hosting](https://www.atlantic.net/vps-hosting/) services and [VPS hosting price](https://www.atlantic.net/vps-hosting/pricing/).
