Updated: 29 September 2026 · Applies to: Rails 8.1 with Ruby 3.3 and later on AlmaLinux and Rocky Linux 9 and 10, RHEL 9 and 10, Debian 13, Ubuntu 24.04 and 26.04

Ruby on Rails is a web application framework written in Ruby. Rails 8.1 (8.1.4 was current on 29 September 2026) needs Ruby 3.2 or later; Ruby 3.2 itself is already out of support, so use Ruby 3.3 or newer. The old guide compiled Ruby with rbenv on CentOS. Current distributions ship a recent enough Ruby, which is simpler to keep updated. We installed Rails 8.1.4 with the system Ruby 3.3 on AlmaLinux 10, created a new application and got its start page (HTTP 200) from the built-in Puma server.

1. Install Ruby and build tools

# AlmaLinux, Rocky Linux, RHEL 10 (Ruby 3.3)
dnf install ruby ruby-devel gcc gcc-c++ make redhat-rpm-config libyaml-devel sqlite-devel zlib-devel openssl-devel git

# AlmaLinux, Rocky Linux, RHEL 9: choose Ruby 3.3 from the module streams first
dnf module enable ruby:3.3
dnf install ruby ruby-devel gcc gcc-c++ make redhat-rpm-config libyaml-devel sqlite-devel zlib-devel openssl-devel git

# Debian 13 (Ruby 3.3)
apt install ruby-full build-essential libyaml-dev libsqlite3-dev zlib1g-dev libssl-dev git

Ubuntu 24.04 ships Ruby 3.2, which is out of support. There, install a current Ruby with a version manager such as rbenv or mise, following its documentation, and then continue with step 2.

Check: ruby -v.

2. Install Rails

gem install rails
rails -v

Installing as root puts Rails in /usr/local/share/gems for all users. The Ruby headers and compilers from step 1 are needed because some gems build native extensions.

3. Create and run an application

As a normal user:

rails new myapp
cd myapp
bin/rails server -b 127.0.0.1 -p 3000

Test with curl -I http://127.0.0.1:3000/ from the server. New applications use SQLite by default; for MySQL, MariaDB or PostgreSQL, create the app with rails new myapp -d mysql or -d postgresql and install the matching client development package first.

4. Going to production

  • Run the app with RAILS_ENV=production, behind Nginx or Apache as a reverse proxy with HTTPS, and keep the app server on 127.0.0.1.
  • Start it with a systemd service, or deploy with Kamal, which Rails 8 includes for container-based deployment.
  • Keep config/master.key secret and out of version control.

Need a VPS for your Rails application? Our experts can set up and deploy it for you.

Official documentation: Rails guides: getting started and Ruby downloads and supported versions.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket