PHPStorm is an integrated development environment from JetBrains for the PHP programming language. It supports all the features of JetBrains' IDE, plus you can install many plugins, for example, for Laravel or Symfony, which add syntax highlighting, autocompletion, and file path lookup considering framework-specific features.
In this article, we will explore how to install PHPStorm on Fedora 41 using Flatpak. Additionally, since the application runs in an isolated environment, we will cover the necessary settings to ensure the IDE has access to everything it needs.
Table of Contents
How to Install PHPStorm in Fedora 41
The traditional way to install desktop applications in Fedora is either through an RPM package from official repositories or a Flatpak package. PHPStorm is not available in the official repositories, but there is a Flatpak package created by a third-party maintainer.
At the time of writing this article, version 2024.3 is available in the repository, but if you want to use an earlier version, you can select the required commit in the Flathub repository, and also prevent updates to a newer version if needed.
1. Add Flathub Repository
If the Flathub repository hasn't been added to your system yet, execute the following command:
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
2. Package Installation
To install the latest version of PHPStorm, execute the command:
flatpak install com.jetbrains.PhpStorm

3. Version Selection
To get the previous version, you still need to install the latest one first. After installation, to find out which versions are available, you need to view the commit history of the FlatHub repository for this package using the following command:
flatpak remote-info --log flathub com.jetbrains.PhpStorm

Note that each commit does not necessarily correspond to a different version. Moreover, all available commits are displayed, and older ones cannot be seen because they are regularly deleted from the repository to save space.
For example, if you want to install version 2024.1, which was released with commit 429f9b9c8f469cc9044dbdefab6d150e674a4eba7e21143ca5f70edd94a51d20, you need to update the package to this commit using the following command:
flatpak update com.jetbrains.PhpStorm --commit=429f9b9c8f469cc9044dbdefab6d150e674a4eba7e21143ca5f70edd94a51d20

After such an update, you need to execute the following command to prevent the program from updating to a newer version when updating all other Flatpak packages:
flatpak mask com.jetbrains.PhpStorm
4. First Launch
The download and installation will take some time, and after that, you can launch the program from the main menu or using the command:
flatpak run com.jetbrains.PhpStorm
After launching the program, in the first window you can select Don't Send to avoid sending data to JetBrains:

And in the next step, you need to either specify the license or activate a 30-day trial version:

After that, the program needs some configuration since it runs in an isolated environment and many resources will be inaccessible to it.
Setting Up PHPStorm in Flatpak
To configure application permissions, you will need the Flatsel utility. To install it, run the command:
flatpak install com.github.tchx84.Flatseal
1. JetBrains Flatpak Wrapper Project
First of all, you need to open the test project that PHPStorm offers to open after installation. The program will ask whether to open it as a project or stay in the lightweight editor. Choose project:

Then select the project folder suggested by the program. The folder is located in the Flatpak package's filesystem:

After that, select Trust Project so that PHPStorm can execute scripts in the project:

2. Embedded Browser Is Suspended Error
This issue may interfere with file preview functionality, and the PHPStorm quick links page won't open, so it's worth fixing. It occurs because PHPStorm cannot launch the browser in a sandbox due to limitations. You can read more about the issue here.

The simplest solution for Flatpak is to disable the sandbox for the browser since creating an AppArmor profile from a Flatpak application won't work. To do this, you basically need to click the Enable Browser... button, and then Disable Sandbox.

The program will save the necessary settings automatically, and after that, it will need to be restarted. Specifically, the option ide.browser.jcef.sandbox.enable will be added to the ~/.var/app/com.jetbrains.PhpStorm/config/JetBrains/PhpStorm2024.3/options/ide.general.xml file with the value false:
<entry key="ide.browser.jcef.sandbox.enable" value="false" source="SYSTEM" />
3. Installing the SDK
Now you can open the JetBrains Flatpak Wrapper project, which contains a README file about the Flatpak version of the program. Here you'll find several useful tips:

First, if you need support for additional programming languages, they should be installed via Flatpak, as the program won't be able to see system executables. For example, for PHP8.4 and Node 22, you need to execute:
flatpak install flathub org.freedesktop.Sdk.Extension.php84
flatpak install flathub org.freedesktop.Sdk.Extension.node22

Then they need to be activated using an environment variable that should be set for the application container:
flatpak override --user com.jetbrains.PhpStorm --env=FLATPAK_ENABLE_SDK_EXT="php84,node22"
The same can be done by adding the corresponding environment variable for the program using Flatseal:

After making changes, PHPStorm needs to be restarted. This allows you not to install these languages in the main system. By default, the PHPStorm terminal now opens in the container. You can verify that the PHP executable is available in the PHPStorm terminal but not accessible in the system.
4. Host System Terminal in PHPStorm
If you want to work with the host system terminal in PHPStorm, you need to use the flatpak-spawn function to launch the bash process in the host system. However, the flatpak-spawn executable itself has several issues that cause the terminal to work but display errors:
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
Therefore, it's better to use the host-spawn utility, which uses the same mechanism but allocates TTY and correctly handles the $TERM environment variable, although it's not yet included in the PHPStorm package. However, this isn't a significant issue since PHPStorm has access to the user's home directory, and the utility can be placed there. To download, execute:
wget https://github.com/1player/host-spawn/releases/download/v1.6.1/host-spawn-x86_64
After that, move the file, for example, to ~/.local/bin/:
mkdir ~/.local/bin/
mv host-spawn-x86_64 ~/.local/bin/host-spawn
And make it executable:
chmod ugo+x ~/.local/bin/host-spawn
In PHPStorm, open Settings -> Tools -> Terminal and enter the following command in Shell Path (of course, replace username with your user login):
/home/username/.local/bin/host-spawn bash

After that, you can try to open the terminal in the IDE again, and there will be no errors, and colors will be supported just like in a regular terminal. However, this should be done in a regular project located in your home directory.
5. Access to Folders
As I wrote before, PHPStorm in Flatpak only has access to the user's home directory. If you want to give the application access to another folder outside the home directory, for example /mnt/share, you need to use the following command:
flatpak override --user com.jetbrains.PhpStorm --filesystem=/mnt/share
The same can be done using Flatseal by adding the required folder to the Other files list in the Filesystem section:

Removing PHPStorm
To remove PHPStorm installed via Flatpak, execute:
flatpak remove com.jetbrains.PhpStorm
By default, the command will only remove the program package, while the data will remain. To remove the data as well, add the --delete-data option:
flatpak remove --delete-data com.jetbrains.PhpStorm
Wrapping Up
As you can see, installing the application using Snap is much simpler since there is no isolation involved. Flatpak requires significantly more configuration but also provides more control over the application. We haven't covered installation from an archive downloaded from the official website or using JetBrains Toolbox, but this information is already available on the program's website.