The Sony PlayStation 4 controller is an excellent device, and it would make a great controller to play video games on Linux. In this guide, we’ll walk you through how to use the PS4 controller on Linux. Let’s get started!
Method 1 – Steam
Valve’s hard work on the Linux version of Steam means that users can enjoy excellent support for third-party video game controllers such as the Sony DualShock 4 (PS4) controller, Nintendo Switch, Microsoft Xbox One and more.
The Steam method is the obvious way to go for the PS4 controller support on Linux for several reasons. For starters, it’s possible to configure the Steam client to adopt other controller styles (like the Xbox) and add it to the PS4. But aside from that, Valve offers up a custom controller mapping tool that users can use to map games to the PS4 controller with ease manually.
Install Steam on Linux
To configure the DualShock 4 controller on Linux via Steam the Steam application must first be installed. Open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. From there, follow the installation instructions that correspond with the distribution you use.
Ubuntu distributes Steam in their official software repositories. To install it, use the Apt package manager to load up Steam.
sudo apt installing steam
The easiest way to install Steam on Linux is to download the standalone DEB package from Steam’s website. The reason downloading is better is that you won’t need to fiddle with your sources file to enable “non-free” packages to install Steam.
To get the latest Steam DEB package, use the wget command below.
Note: you will need to enable 32-bit architecture to use Steam on Debian.
With “steam.deb” done downloading, use the dpkg tool to load it up on the system.
sudo dpkg -i steam.deb
Finish up the installation with apt-get install -f.
sudo apt-get install -f
Steam is in the official Arch Linux software repositories. To install it, use the Pacman package management command below.
sudo pacman -S steam
Steam is available to Fedora users through the RPMFusion software repository. To enable these repos, do the following command-line operations.
Note: replace XX in the commands below with the release number of Fedora Linux you use.
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-XX.noarch.rpm -y
sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-XX.noarch.rpm -y
With the repos enabled, install Steam with Dnf.
sudo dnf install steam -y
Use OpenSUSE and need Steam? Head over to the OBS and download the package that best matches your release of the operating system!
Ensure you have the Flatpak runtime enabled. Then, enter the following commands to load up Steam.
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak install flathub com.valvesoftware.Steam
After installing Steam on your Linux PC, log into your account and open the app.
Configure the PS4 Controller in Steam
Now that the Steam app is installed and open on your Linux PC, plug in your PS4 via USB to your PC or pair it via Bluetooth by pressing Share + the PS button if you prefer.
Once the controller is connected to your Linux PC, go to the Steam app, find the “Steam” menu and click on it. Then, select the “Settings” menu inside to access the Steam settings area.
Inside the Steam settings area, find “Controller” and select it. Then, choose “GENERAL CONTROLLER SETTINGS.”
In the “GENERAL CONTROLLER SETTINGS” area, check the box next to “PlayStation Configuration Support.” Then, scroll down, and you should see “Unregistered PlayStation controller.” Click it and register it to your Steam account.
With the PlayStation 4 controller registered to your Steam account, you’ll now be able to use it to play video games in your Steam library, as well as third-party ones added to Steam through the “Add a Game” feature.
Method 2 – DS4DRV
The Dualshock 4 userspace driver for Linux is an older driver, but it’s confirmed to give users excellent support for the Sony DualShock 4 (PS4) controller on most Linux-based operating systems.
Installing the DS4DRV driver is done through the Python packaging tool, meaning that even Linux distributions that are lesser-known should have no issue installing it. To start the installation, open up a terminal and run pip –help followed by python –version.
Note: you will also need to install “python-setuptools.” More information on that here.
Assuming the “help” function shows that Pip works and you can confirm you have Python 2.7 or higher, use the pip install command to load up the DS4DRV driver onto your Linux PC.
sudo pip install ds4drv
Connect your Ps4 controller
With the DS4DRV driver working, it’s time to connect it to the system to use it on Linux. Plug in your PS4 controller into the USB port on your PC. Alternatively, hold down the Share + PS button to enter it into Bluetooth mode. From there, follow this guide to learn how to pair it to your computer wirelessly.
Once you’ve got your PS4 controller paired to your Linux PC, return to the terminal and run ds4drv.
If the command is successful, your DualShock 4 controller should work in any game you start up on the system with no trouble! For more information on how to use DS4DRV, including it’s more advanced functions we didn’t cover, click here.