You’re here to write code — something that runs fast, stays stable, and doesn’t crash when you need it most. Rust isn’t just another language. It’s the tool developers use when performance matters: servers, embedded systems, network tools. And if you’re building anything serious, you need real hardware behind it. This guide walks you through installing Rust on a clean Ubuntu 22.04 VPS Just you, the terminal, and the compiler.
How To Set Up Rust on Ubuntu VPS: A Step-by-Step Guide 2026
Step 1. Connect to Your VPS via SSH
You’ll need an SSH client — like PuTTY on Windows or Terminal on Mac or Linux. Open it, then type:
Replace ip-address with the actual IP address your VPS provider gave you. Press Enter. You’ll be asked for a password — paste the one from your welcome email. If you see a prompt like root@server:~#, you’re in. This is your server’s command line. Everything you type here runs directly on the machine.
Step 2. Update Your System & Install Essential Tools
Your server came with a base OS, but it might be outdated. Run this to get the latest fixes and security patches:
Apt is Ubuntu’s package manager. Update checks for new versions. Upgrade installs them. The -y tells the system to say “yes” automatically to prompts. Wait until you see the prompt again. Don’t rush this step.
You need three programs to continue:
- curl to download files from the internet;
- nano to edit text files (like code);
- unzip to unpack files later.
Install them all at once:
Again, -y skips confirmation. These are your basic tools.
Step 3. Install Rust via rustup
Rust changes often. The official installer, rustup, handles versions for you. Run:
This downloads a script and runs it. You’ll see a menu. Type 1 and press Enter. It will install Rust into your user folder. This takes a few minutes. Don’t close the window.
The installer put Rust in a place your terminal doesn’t know about yet. Run this to fix that:
This tells your current session where to find Rust tools. Now check if it worked:
You should see something like rustc 1.91.1. If you see an error, restart your SSH session and try again. This step is easy to miss — but it’s required.
Step 4. Install Build Tools
Rust doesn’t compile itself. It needs a C compiler and tools to turn your code into a program. Install them:
This adds gcc, make, and other low-level tools. Without them, rustc will fail with confusing errors. This is like installing drivers for your printer — you don’t see it, but nothing works without it.
Step 5. Create a Test Project Folder
Organize your work so you don’t lose files later. Run these commands one after another:
This creates a folder called rustprojects inside your home directory.
This moves you into that folder.
Creates a subfolder for your first project.
Moves you inside it. You’re now in ~/rustprojects/testdir. Your terminal prompt will show it. This is where your code lives.
Use the nano text editor to create a file:
A blank screen opens. Type this exactly:
Don’t add extra spaces or quotes. When done, press Ctrl+X. You’ll see “Save modified buffer?” Type y then press Enter. Then press Enter again to confirm the filename test.rs. You’ve just written your first Rust program.
Now turn your code into a program:
This creates a file called test (no extension). It’s not a .exe — it’s a Linux binary. Run it with:
The ./ means “run this file from the current folder.” You should see: Congratulations! Your Rust program works. If you do, you’ve compiled and run Rust on a real server. That’s the milestone.
Step 6. Keep Rust Updated
Rust improves every six weeks. To update later:
It will download and install the latest version.
To remove Rust completely:
It deletes everything.
Conclusion
Rust gives you speed, safety, and control — whether you’re writing a CLI tool, a microservice, or a system-level library. But none of that matters if your environment is shared, throttled, or unstable. That’s why you need a real VPS: full root access, SSD storage, and dedicated resources. No middlemen. No restrictions. Just you, your code, and hardware that doesn’t flinch under load. If you’re serious about building with Rust, start with infrastructure that doesn’t hold you back. See our VPS plans. Build something that lasts.