How I Managed to Play AAA Games on Raspberry Pi

You can utilize your Raspberry Pi to experience games too, with a catch!
Warp Terminal

Have you ever thought of running high-end AAA games on a Raspberry Pi? Absurd right?

Spoiler alert: you can’t. Of course.

But, you may ask — what about the article's title?

In fairness, please note that I mentioned "Play" instead of "Run." That is the crucial aspect of my experiment 🤓

You cannot run the game, but what you can do is stream those demanding games from a powerful PC to your Raspberry Pi using Moonlight, and it works like a charm!

a screenshot of steam running via moonlight

In this article, I’ll show you how I turned my humble Raspberry Pi 5 into a game-streaming powerhouse.

Stick with me for a breakdown of every step you need to replicate this feat. And don’t worry—I’ll try keeping the technical jargon at bay.

What is Moonlight?

Picture this: your beastly gaming rig is upstairs, but your comfy couch (and bigger TV) is downstairs.

Instead of running an HDMI cable across the house, you can use Moonlight to stream your games over your home network. Moonlight uses Nvidia’s GameStream technology to deliver smooth, high-definition, low-latency gameplay.

The Raspberry Pi, with its small form factor and affordable price, makes the perfect device for this setup.

Whether you’re using a Raspberry Pi 4 or the newer Raspberry Pi 5, Moonlight can help you bring AAA gaming to the comfort of any room.

What You’ll Need

Here’s the gear that I used for this project:

💡
A wired connection is highly recommended for both your Raspberry Pi and your PC for the best experience.
  • Raspberry Pi 4/5 (the more powerful, the better)
  • MicroSD Card (16 GB or larger, for the OS)
  • Ethernet Cable (for low latency)
  • USB Mouse and Keyboard
  • Controller (Xbox or PlayStation, optional but recommended)
  • A PC with a Compatible Nvidia GPU (running Sunshine, an open-source GameStream host)

Step 1: Preparing Your Raspberry Pi

Start by making sure your Raspberry Pi is updated. Open the terminal and run these commands:

sudo apt update && sudo apt full-upgrade -y
updating and upgrading the raspberry pi

You will need curl for downloading the repository and pulseaudio for audio support. Install them with:

sudo apt install curl pulseaudio
installing curl and pusleaudio

Set PulseAudio to start automatically when the Pi boots:

sudo systemctl --global enable pulseaudio
now we need to enable pulseaudio to start automatically at startup

Step 2: Installing Moonlight

Run the following command to add the Moonlight package repository:

curl -1sLf 'https://dl.cloudsmith.io/public/moonlight-game-streaming/moonlight-qt/setup.deb.sh' | distro=raspbian codename=$(lsb_release -cs) sudo -E bash
adding moonlight repository

Once the repository is added, install Moonlight with:

sudo apt install moonlight-qt
installing moonlight using apt package manager

Step 3: Configuring Moonlight

Edit the crontab file to launch Moonlight automatically when your Pi starts. This way, you get a seamless experience.

crontab -e
editing crontab with nano to add moonlight

Add this line at the end of the file:

@reboot moonlight-qt
adding moonlight startup record in the crontab file

Reboot your Pi to apply the changes:

sudo reboot now

Step 4: Pairing Moonlight with your PC

Download and install Sunshine, an open-source GameStream server, on your PC. This is essential for pairing with Moonlight.

github release page to download the sunshine exe

Once installed, it will redirect you to a browser window, where you need to set up a user first before you can access anything:

creating a use to access sunshine

Once done, you are ready to launch Moonlight on your Raspberry Pi.

💡
If your PC doesn’t appear automatically, click the + icon and manually enter your PC’s IP address.
starting moonlight in raspberry pi from the main menu

You’ll be prompted with a PIN code. Enter this PIN in the Sunshine web interface on your PC to complete the pairing.

pin prompt in moonlight

You need to enter this PIN here in the Sunshine web UI:

adding the moonlight pin in the sunshine webui

Sunshine should automatically add the desktop to stream, but you can manually use Sunshine’s web interface to add specific applications, the desktop, or games to the list of streamable apps.

applications add or remove to access via moonlight in raspberry pi

Step 5: Start Streaming!

With everything set up, you can now stream games to your Raspberry Pi. Connect your controller, choose a game from the Moonlight interface, and enjoy the magic of high-performance gaming on your Pi.

If you are wondering the input lag and poor framerate, that's all because I tested this whole setup on Wi-Fi just for the tutorial. Unlike me, you are smart and will use a wired connection.

Final Thoughts

Running AAA games directly on a Raspberry Pi is not an ideal thought because of what it's built for. Thanks to Moonlight, you can stream games effortlessly on your Raspberry Pi, so it is always useful in one way or the other.

With a bit of preparation, your Raspberry Pi can transform into a versatile gaming client, letting you enjoy PC-quality gaming anywhere in your home.

💭 Have questions or tips of your own? Drop them in the comments below, I’d love to hear from you!

Happy streaming! 🎮

About the author
Abhishek Kumar

Abhishek Kumar

I'm definitely not a nerd, perhaps a geek who likes to tinker around with whatever tech I get my hands on. Figuring things out on my own gives me joy. BTW, I don't use Arch.

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.