---
title: "Deploy Rocky Linux"
description: "[Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀"
category: "Other"
url: https://railway.com/deploy/rocky-linux
---

# Deploy Rocky Linux

[Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

**[Deploy Rocky Linux on Railway](https://railway.com/template/rocky-linux)**

- **Creator:** codestorm
- **Category:** Other
- **Total deploys:** 40

## Template content

### rocky-linux https://raw.githubusercontent.com/docker-library/docs/5e29cd0cdc96d579d91310cbcb772b26067182ad/rockylinux/logo.png

- **Image:** rockylinux:9
- **Start command:** `bash -lc 'echo "container is running on Railway"; tail -f /dev/null'`

## Documentation

![img](https://img.shields.io/badge/Railway-Supported-blue?logo=railway)
# Deploy and Host Rocky Linux SSH on Railway

Rocky Linux SSH is a cloud-hosted Linux workspace that can be accessed through Railway SSH. It uses the official `rockylinux:9` container image, providing a Red Hat Enterprise Linux compatible environment for diagnostics, development, testing, package workflows, automation, and isolated Linux tasks with persistent storage support through Railway Volume.

![Imgur](https://imgur.com/VcPMbev.png)

## About Hosting Rocky Linux SSH

Hosting Rocky Linux SSH on Railway involves deploying a containerized Rocky Linux 9 environment that can be accessed securely using Railway CLI SSH. Rocky Linux is a community-driven enterprise Linux distribution designed to be compatible with Red Hat Enterprise Linux, making it useful for users who want an RPM-based Linux environment for testing commands, packages, scripts, and server-style workflows.

Instead of manually provisioning a VPS, Railway manages the deployment, runtime, networking, environment, and infrastructure layer for you. After the template is deployed, you can connect to the running Rocky Linux container from your local terminal, inspect the system, install packages with `dnf`, run diagnostic commands, test shell scripts, verify Linux behavior, and store persistent files inside a mounted Railway Volume.

This template is useful as a lightweight enterprise Linux workspace, a debugging shell, a package testing environment, or an isolated cloud-hosted command-line sandbox for developers, students, system administrators, and DevOps workflows.

## Common Use Cases

* Remote Rocky Linux shell for diagnostics, testing, and debugging
* Enterprise Linux compatible development sandbox with SSH access
* Testing RPM-based packages, binaries, scripts, and automation workflows
* Running Linux commands in an isolated cloud-hosted environment
* Creating a persistent workspace for logs, generated files, and project data
* Practicing `dnf`, system inspection, package installation, and shell commands
* Running lightweight background tools or infrastructure-related experiments

## Dependencies for Rocky Linux SSH Hosting

* Railway account for deploying and managing the Rocky Linux service
* Railway CLI installed locally or on your VPS to access the container through SSH
* Railway Volume for persistent storage across restarts and redeployments
* A terminal application on your local machine, VPS, or development environment

### Deployment Dependencies

This template uses the following components and resources:

* Official Rocky Linux Docker image: [`rockylinux:9`](https://hub.docker.com/_/rockylinux)
* Railway CLI: [https://docs.railway.com/cli](https://docs.railway.com/cli)
* Railway SSH guide: [https://docs.railway.com/guides/ssh](https://docs.railway.com/guides/ssh)
* Railway Volumes: [https://docs.railway.com/reference/volumes](https://docs.railway.com/reference/volumes)

The `rockylinux:9` image provides a Rocky Linux 9 base environment. It is suitable for workflows that need a modern RPM-based Linux system with `dnf` package management and compatibility with enterprise Linux tooling.

## How to Use This Template via Railway Console

After deploying this template, you can use the Railway Console to run commands directly inside the deployed service environment.

This is useful for setup commands, authentication commands, maintenance tasks, debugging, or running CLI tools provided by the application.

### Steps

1. Open your Railway project.
2. Select the service created from this template.
3. Open the **Console** tab.
4. Wait until the console session is ready.
5. Type or paste the command you want to run.
6. Press **Enter** to execute the command.

Example:

```bash
cat /etc/os-release
```

## How to Use This Template via Railway CLI

After the template is deployed, install and log in to the Railway CLI.

If you use npm, install Railway CLI with:

```bash
npm install -g @railway/cli
```

Verify that the Railway CLI is available:

```bash
railway --version
```

Log in to your Railway account:

```bash
railway login
```

For headless environments, remote servers, or VPS usage, use browserless login:

```bash
railway login --browserless
```

To connect to the deployed Rocky Linux container, copy the SSH command from the Railway dashboard.

Steps:

1. Open your Railway project.
2. Right-click the deployed Rocky Linux service.
3. Select **Copy SSH Command**.
4. Paste and run the command in your terminal.

The command will look similar to this:

```bash
railway ssh --project= --environment= --service=
```

Once connected, you are inside the running Rocky Linux 9 container.

## Verify the Rocky Linux Environment

Inside the SSH session, verify the operating system:

```bash
cat /etc/os-release
```

You should see Rocky Linux 9 information.

You can also check the kernel and architecture:

```bash
uname -a
```

Check available disk space and mounted paths:

```bash
df -h
```

Inspect the current user and working directory:

```bash
whoami
pwd
```

## Use Persistent Storage

This template supports persistent storage through a Railway Volume. Use the mounted volume path for files that should survive service restarts and redeployments.

A common mount path is:

```bash
/data
```

Check the volume:

```bash
ls -la /data
```

Create a test file inside the volume:

```bash
echo "hello from railway rocky linux" &gt; /data/test.txt
cat /data/test.txt
```

Files stored inside the persistent volume are retained across service restarts and redeployments. Avoid relying on the container root filesystem for important files because container files outside the mounted volume may be lost when the service is rebuilt or redeployed.

## Install Packages and Run Commands

Rocky Linux uses `dnf` as its package manager. You can install packages during your SSH session or as part of your workflow.

Update package metadata:

```bash
dnf update -y
```

Install common tools:

```bash
dnf install -y curl wget nano vim git htop procps-ng iproute
```

Run commands as needed:

```bash
curl --version
git --version
htop
```

Some minimal container images may not include every common utility by default. Install only the packages you need to keep the environment lightweight.

## Working With Files

You can use the Rocky Linux container as a small cloud workspace for temporary or persistent tasks.

For temporary files, use standard Linux paths such as:

```bash
/tmp
/root
```

For files that should persist, use the Railway Volume path:

```bash
/data
```

Example project directory:

```bash
mkdir -p /data/workspace
cd /data/workspace
```

Create a script:

```bash
cat &gt; hello.sh &lt;&lt;'EOF'
#!/usr/bin/env bash
echo "Hello from Rocky Linux on Railway"
cat /etc/os-release
EOF
```

Make it executable and run it:

```bash
chmod +x hello.sh
./hello.sh
```

## Example Diagnostics

Rocky Linux SSH can be useful for basic Linux and network diagnostics.

Check OS information:

```bash
cat /etc/os-release
```

Check CPU information:

```bash
cat /proc/cpuinfo | head
```

Check memory information:

```bash
free -h
```

Check disk usage:

```bash
df -h
```

Check running processes:

```bash
ps aux
```

Check network interfaces:

```bash
ip addr
```

If a command is not available, install the related package with `dnf`.

## Notes

* Use the Railway dashboard to manage deployment, variables, volumes, and service settings.
* Use Railway CLI when you need SSH access, logs, diagnostics, or project-level commands.
* Store important files, generated artifacts, logs, and project data inside the mounted volume, such as `/data`.
* Avoid relying on the container root filesystem for important persistent files.
* Rocky Linux uses `dnf`, not `apt`.
* The `rockylinux:9` image is useful when you need an RPM-based enterprise Linux compatible environment.
* Container environments are not full virtual machines, so some low-level system services may behave differently than on a traditional VPS.
* Install only the tools required for your workflow to keep the container clean and lightweight.

## Useful Links

* Official Rocky Linux Docker image: [https://hub.docker.com/_/rockylinux](https://hub.docker.com/_/rockylinux)
* Rocky Linux official website: [https://rockylinux.org/](https://rockylinux.org/)
* Railway CLI: [https://docs.railway.com/cli](https://docs.railway.com/cli)
* Railway SSH guide: [https://docs.railway.com/guides/ssh](https://docs.railway.com/guides/ssh)
* Railway Volumes: [https://docs.railway.com/reference/volumes](https://docs.railway.com/reference/volumes)

## Why Deploy Rocky Linux SSH on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Rocky Linux SSH on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.
- [(v1) Simple Medusa Backend](https://railway.com/deploy/pwNTJ1) — Deploy an ecommerce backend and admin using Medusa

Open this page in a browser: https://railway.com/deploy/rocky-linux
