Why Linux is the developer's home

Free preview 4 min to read

The server is already Linux

Here is a fact that changes how you should think about your laptop: almost every Rails application in the world runs on Linux in production. When you deploy to a VPS, to Heroku, to Fly.io, or to a Kubernetes cluster, your code runs on a Linux machine.

Developing on Linux puts you as near to production as you can get: the same package manager, the same filesystem layout, the same process model, the same shell. Errors you hit locally are the errors you will hit on the server: and you will already know how to fix them.

This course sets up a complete Rails development environment on Ubuntu (and other Debian-based distributions). If you use Fedora or Arch, the concepts are identical; only the package manager commands change.

What you are going to build

A development environment is the set of tools that let you write, run, test and debug code. By the end of this course you will have:

+-------------------------------------------------------+
|             YOUR LINUX DEVELOPMENT ENVIRONMENT        |
|                                                       |
|  +----------------+   +--------------------------+    |
|  | Terminal       |   | Package manager          |    |
|  | (bash or zsh)  |   | (apt)                    |    |
|  +----------------+   +--------------------------+    |
|                                                       |
|  +----------------+   +--------------------------+    |
|  | Build tools    |   | Ruby version manager     |    |
|  | (build-        |   | (rbenv + ruby-build)     |    |
|  |  essential)    |   +--------------------------+    |
|  +----------------+                                   |
|                       +--------------------------+    |
|  +----------------+   | Database                 |    |
|  | Code editor    |   | (PostgreSQL)             |    |
|  | (VS Code)      |   +--------------------------+    |
|  +----------------+                                   |
|                       +--------------------------+    |
|                       | Rails + Puma             |    |
|                       +--------------------------+    |
+-------------------------------------------------------+

Each piece has a job:

Tool Job Linux equivalent of…
apt Installs system software Homebrew on macOS
build-essential Compilers (gcc, make) that build Ruby and native gems Xcode Command Line Tools
rbenv Installs and switches Ruby versions per project Same on macOS
PostgreSQL The database Rails talks to Same on macOS
VS Code Where you write code Same on macOS

Which Linux?

Linux comes in distributions ("distros"): the same kernel, different packaging and defaults.

Distribution Package manager Use it if…
Ubuntu / Debian / Pop!_OS / Mint apt You want the most tutorials and the fewest surprises (this course)
Fedora dnf You like newer packages and don't mind translating commands
Arch / Manjaro pacman You enjoy configuring everything yourself

Ubuntu LTS ("Long Term Support") releases are the safest choice for development: they get updates for five years and most Linux tutorials target them. If you are choosing today, pick the latest LTS.

Check what you have

Open a terminal (Ctrl + Alt + T on Ubuntu) and run:

lsb_release -a
uname -m

You should see something like:

Distributor ID: Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:        24.04
Codename:       noble
x86_64

Two things matter here: the release (24.04 or newer is ideal) and the architecture (x86_64 or aarch64). Both are fine for Rails.

How this course is organized

  1. Update the system and install build tools with apt
  2. Get comfortable with the shell (bash vs zsh)
  3. Install Ruby with rbenv
  4. Install and configure PostgreSQL
  5. Set up VS Code
  6. Create and run your first Rails app

Every command in this course was tested on Ubuntu 24.04. Type them yourself instead of copying: your fingers learn faster than your eyes.

What about a Mac or Windows?

You can, and the platform has courses for both. But Linux has three concrete advantages for a Rails developer:

  • Parity with production: no surprises when you deploy.
  • Speed: no virtualization layer or WSL in between.
  • Transparency: everything is a file or a process you can inspect. When you learn Linux, you learn how servers work.

Let's set up your kitchen.

Lesson 1 of 7 · free

Keep going with lesson 2

apt & build-essential: your package manager and compilers

Uses apt and sudo to update the system and install build-essential plus the libraries Ruby needs.

A free account also gives you the quizzes, your progress and notes, and the discussion.

Type to start searching...