Automatically start Steam Link on Raspberry Pi

Steam and Raspberry Pi Logos

Update for Raspberry Pi 4 and Debian Buster

It is no longer possible to start Steam Link via systemd on the Raspberry Pi 4 with Debian Buster. A minimal X session is required. This also means that headless is not possible either.

The recommended method now, to start Steam Link at boot, is using the desktop autostart settings. Unfortunately we lose some of systemd's nice features, like restart on crash, but basic boot-to-Steam Link functionality will work.

1. Open autostart file

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

2. Add Steam Link

Add the following line to end of the file:

@steamlink

Save using Ctrl-o and exit using Ctrl-x

Reboot and Steam Link will launch once the desktop is loaded.


Original Post

After writing about my experiences with Steam Link on the Raspberry Pi, I thought I could address one of my complaints. The Steam Link app on the Raspberry Pi doesn't boot automatically into the program by default. A mouse or keyboard is needed to actually get into the application and not everybody wants to have another peripheral permanently connected.

Using systemd, it's relatively easy to create a service that will ensure the Steam Link is app is running. Regardless of the bad press, systemd makes common tasks like this super easy and offers a lot of customization.

Note: For this guide I'm assuming that you already have the latest Raspbian and the Steam Link package already installed.

1. Create the service file

Use nano to open a new file:

sudo nano /etc/systemd/system/steamlink.service

Then paste the following into the editor:

[Unit]
Description=Start Steam Link at desktop load

[Service]
Type=simple
User=pi
ExecStart=/usr/bin/steamlink
#Restart=always
Restart=on-failure

[Install]
WantedBy=graphical.target
#WantedBy=multi-user.target

Save the file using Ctrl-o, Enter, Ctrl-x.

If you would like Steam Link to always be running, even when exiting normally, then uncomment the 'Restart=always' line and delete the 'Restart=on-failure' line. But make sure you can ssh into your Raspberry Pi to change it back if you need to as this will force Steam Link into full view all the time.

If you don't have a graphical desktop installed, you can also switch the commenting of the 'WantedBy' line for a truly headless Steam Link.

2. Enable the service

Again, from the terminal, run the following commands to enable the new service that we just created:

sudo systemctl daemon-reload
sudo systemctl enable steamlink.service

That's it! Reboot your Raspberry Pi and it should go directly into the Steam Link app so you can start streaming.

I've also uploaded the service file to Github, with instructions on how to install from git.

Was this article helpful? Consider leaving a comment.


Tags: