Skip to content

Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS

Netcloud24
Cloud Infrastructure Expert
HOSTING H1

Free web hosting H1

5 GB of storage and SSL for a small website or WordPress project.

Explore hosting H1
WINDOWS VPS + RDS

Run Windows applications remotely

Windows Server 2022 or 2025 and RDS CALs included in the plan. Choose resources and user capacity for your business.

Explore Windows VPS
NetCloud24 Expert Guides Open the dedicated video page

Video transcript: NetCloud24 Expert Guides. Practical knowledge for a reliable cloud. Cloud and VPS expertise, security, performance, and step-by-step tutorials. Learn, deploy, and keep building with NetCloud24.

 

 

Ruby on Rails, also known as Rails, is a powerful web development framework written in Ruby. It allows developers to build high-performing web applications quickly and efficiently. In this guide, we will walk you through the steps to install Ruby on Rails on Ubuntu 20.04 LTS. Whether you’re using a or another hosting solution, Rails provides a great foundation for building dynamic web apps.

Prerequisites

Before starting, ensure you have the following:

Step 1: Update Your System

Start by updating your system to ensure all packages are up to date. Run the following commands:

sudo apt update && sudo apt upgrade -y

Step 2: Install Ruby

Ruby on Rails is built on Ruby, so the first step is to install Ruby. You can install it using the package manager:

sudo apt install ruby-full -y

Once installed, verify the Ruby version by running:

ruby -v

This command should display the Ruby version, confirming that Ruby is installed.

Visual overview of Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS
Visual overview: Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS

Step 3: Install Node.js and Yarn

Rails requires a JavaScript runtime to work properly, so you will need to install Node.js. You can also install Yarn, a JavaScript package manager, which is often used with Rails projects:

sudo apt install nodejs
sudo apt install yarn -y

Step 4: Install Rails

Next, install Rails using the RubyGems package manager. Run the following command to install Rails:

sudo gem install rails

Once the installation is complete, verify the Rails version by running:

rails -v

This will display the installed Rails version.

Step 5: Install a Database (Optional)

Ruby on Rails supports several databases, but the most common choice is PostgreSQL or MySQL. You can install PostgreSQL by running:

sudo apt install postgresql postgresql-contrib libpq-dev -y

Alternatively, for MySQL, run:

sudo apt install mysql-server mysql-client libmysqlclient-dev -y

Step 6: Create a New Rails Project

Now that Ruby, Rails, and the database are installed, you can create a new Rails project. Navigate to the directory where you want to store your project and run:

rails new myapp -d postgresql

Replace myapp with your project name, and if you are using MySQL, replace -d postgresql with -d mysql.

Key topics covered in Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS
Key topics covered in this NetCloud24 guide.

Step 7: Set Up the Database

If you are using PostgreSQL, you will need to create a database user. Log in to PostgreSQL:

sudo -u postgres psql

Create a new user with a password:

CREATE ROLE myuser WITH LOGIN PASSWORD 'mypassword';

Then, grant the necessary permissions and exit:

ALTER ROLE myuser CREATEDB;
\q

Update the database configuration file config/database.yml in your Rails project directory to match your database settings, then set up the database:

rails db:create

Step 8: Start the Rails Server

To test that everything is working, start the Rails development server:

rails server

By default, the server will run on port 3000. Open your web browser and navigate to http://your-server-ip:3000 to see the Rails welcome page.

Conclusion

By following these steps, you have successfully installed Ruby on Rails on Ubuntu 20.04 LTS. Whether you’re developing applications on a , Microsoft SQL VPS Windows, or any Windows VPSVirtual Private Server Hosting environment, Rails provides a robust platform for building scalable web applications.

Practical checklist for Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS
Practical checklist for applying the guidance in this article.
Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS
Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS
Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.

Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS

Netcloud24
Cloud Infrastructure Expert
HOSTING H1

Free web hosting H1

5 GB of storage and SSL for a small website or WordPress project.

Explore hosting H1
WINDOWS VPS + RDS

Run Windows applications remotely

Windows Server 2022 or 2025 and RDS CALs included in the plan. Choose resources and user capacity for your business.

Explore Windows VPS
NetCloud24 Expert Guides Open the dedicated video page

Video transcript: NetCloud24 Expert Guides. Practical knowledge for a reliable cloud. Cloud and VPS expertise, security, performance, and step-by-step tutorials. Learn, deploy, and keep building with NetCloud24.

 

 

Ruby on Rails, also known as Rails, is a powerful web development framework written in Ruby. It allows developers to build high-performing web applications quickly and efficiently. In this guide, we will walk you through the steps to install Ruby on Rails on Ubuntu 20.04 LTS. Whether you’re using a or another hosting solution, Rails provides a great foundation for building dynamic web apps.

Prerequisites

Before starting, ensure you have the following:

Step 1: Update Your System

Start by updating your system to ensure all packages are up to date. Run the following commands:

sudo apt update && sudo apt upgrade -y

Step 2: Install Ruby

Ruby on Rails is built on Ruby, so the first step is to install Ruby. You can install it using the package manager:

sudo apt install ruby-full -y

Once installed, verify the Ruby version by running:

ruby -v

This command should display the Ruby version, confirming that Ruby is installed.

Visual overview of Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS
Visual overview: Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS

Step 3: Install Node.js and Yarn

Rails requires a JavaScript runtime to work properly, so you will need to install Node.js. You can also install Yarn, a JavaScript package manager, which is often used with Rails projects:

sudo apt install nodejs
sudo apt install yarn -y

Step 4: Install Rails

Next, install Rails using the RubyGems package manager. Run the following command to install Rails:

sudo gem install rails

Once the installation is complete, verify the Rails version by running:

rails -v

This will display the installed Rails version.

Step 5: Install a Database (Optional)

Ruby on Rails supports several databases, but the most common choice is PostgreSQL or MySQL. You can install PostgreSQL by running:

sudo apt install postgresql postgresql-contrib libpq-dev -y

Alternatively, for MySQL, run:

sudo apt install mysql-server mysql-client libmysqlclient-dev -y

Step 6: Create a New Rails Project

Now that Ruby, Rails, and the database are installed, you can create a new Rails project. Navigate to the directory where you want to store your project and run:

rails new myapp -d postgresql

Replace myapp with your project name, and if you are using MySQL, replace -d postgresql with -d mysql.

Key topics covered in Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS
Key topics covered in this NetCloud24 guide.

Step 7: Set Up the Database

If you are using PostgreSQL, you will need to create a database user. Log in to PostgreSQL:

sudo -u postgres psql

Create a new user with a password:

CREATE ROLE myuser WITH LOGIN PASSWORD 'mypassword';

Then, grant the necessary permissions and exit:

ALTER ROLE myuser CREATEDB;
\q

Update the database configuration file config/database.yml in your Rails project directory to match your database settings, then set up the database:

rails db:create

Step 8: Start the Rails Server

To test that everything is working, start the Rails development server:

rails server

By default, the server will run on port 3000. Open your web browser and navigate to http://your-server-ip:3000 to see the Rails welcome page.

Conclusion

By following these steps, you have successfully installed Ruby on Rails on Ubuntu 20.04 LTS. Whether you’re developing applications on a , Microsoft SQL VPS Windows, or any Windows VPSVirtual Private Server Hosting environment, Rails provides a robust platform for building scalable web applications.

Practical checklist for Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS
Practical checklist for applying the guidance in this article.
Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS
Linux VPS & VPS Windows Setup Guide | NetCloud24 Ruby on Rails on Ubuntu 20.04 LTS
Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.