Flatpak is a package management system that provides a consistent way to build, install, and run software across different Linux distributions. Developed to simplify application distribution on Linux, Flatpak creates a universal format for applications, allowing them to run on almost any Linux distribution without worrying about compatibility issues.
Key Features of Flatpak
- Cross-Distribution Compatibility: Flatpak packages, also known as “flatpaks,” can run on virtually any Linux distribution, providing a unified solution to package distribution. This eliminates the need to maintain separate builds for different Linux environments.
- Sandboxing and Security: Flatpak runs applications in a sandbox, isolating them from the rest of the system. This approach enhances security by restricting an application’s access to system resources unless explicitly permitted, reducing the risk of malicious behavior or accidental system changes.
- Frequent Updates: Applications distributed through Flatpak can receive updates independently of the base operating system. Flatpak also supports delta updates, which means only the changed parts of an application are downloaded during an update, reducing the amount of data that needs to be transferred.
- Runtime Libraries: Flatpak uses “runtimes”—pre-packaged sets of libraries that applications need to run. By using runtimes, Flatpak applications can share common components, reducing redundancy and simplifying the development process. Developers can target specific runtime environments that contain the dependencies their application needs, making the apps more portable.
- Flathub Repository: Flatpak has an official repository called Flathub, which provides access to a wide range of applications. It serves as the central hub where users can discover, install, and update Flatpak applications. Users can also add other repositories if they want access to software not available on Flathub.
- Compatibility with Multiple Environments: Flatpak apps are not tied to a specific desktop environment, which means they will run regardless of whether the user is using GNOME, KDE, or any other Linux desktop environment. This makes it a versatile choice for both developers and end users.
- User-Level Installation: Flatpak allows users to install applications on their own user accounts without requiring administrator privileges. This makes it convenient for users who don’t have root access but still want to install new software.
How Flatpak Works
Flatpak works by containerizing applications along with their dependencies and running them in an isolated environment on the host system. This ensures that the application can run consistently regardless of changes to the underlying system. Flatpak also uses two main components:
- Runtimes: These are sets of libraries that applications need to run, which can be shared among multiple Flatpak applications.
- Application Bundles: These contain the application itself and any specific libraries that are not covered by the runtime.
Flatpak apps are installed using a command like:
flatpak install flathub org.example.ApplicationName
The command retrieves the application and its runtime from Flathub or any other specified repository.
Use Cases for Flatpak
- Unified Application Deployment: Flatpak is perfect for developers who want to ensure that their applications run smoothly across all Linux distributions without maintaining multiple package formats (like DEB for Debian-based systems or RPM for Red Hat-based systems).
- Increased Application Security: Flatpak’s sandboxing capabilities are ideal for applications that need to be run with a higher level of security, as they limit the resources that an application can access on the system.
- User-Friendly App Store: With Flathub, Flatpak provides a centralized app store experience, making it easier for users to find, install, and update applications across multiple distributions.
- Ease of Testing: Developers can use Flatpak to create consistent testing environments. Since applications and their dependencies are bundled together, there’s no need to worry about differences in library versions on test systems versus user systems.
Advantages of Flatpak
- Distribution Independence: Flatpak works across different Linux distributions, offering a universal package format.
- Sandboxing and Security: Applications run in a sandboxed environment, which provides additional layers of security and minimizes the risk of system modifications.
- Ease of Development: By bundling dependencies with applications, developers can reduce compatibility issues across different Linux systems.
- Centralized App Store: Flathub provides a simple, centralized repository where users can find and install software.
Limitations
- Increased Disk Space Usage: Since Flatpak bundles applications along with their dependencies, this can lead to larger package sizes compared to native package management systems, which rely on shared libraries.
- Runtime Overheads: Applications may require specific runtimes, which also need to be downloaded, potentially leading to additional storage requirements.
- Not Always Lightweight: Flatpak applications tend to use more resources compared to native apps due to sandboxing and containerization.
Flatpak vs Snap and AppImage
Flatpak is often compared to Snap and AppImage, as all three aim to solve similar challenges regarding application distribution on Linux:
- Flatpak is primarily focused on desktop applications and offers robust sandboxing with a focus on security.
- Snap (by Canonical) is also a cross-distribution package format that can handle both desktop and server applications. It uses similar containerized principles but is managed centrally by Canonical.
- AppImage creates self-contained executables without sandboxing. It provides portability but lacks the security features that Flatpak and Snap offer.
Flatpak has gained popularity among developers and end-users due to its versatility, ease of use, and robust security features. It’s an excellent choice for users looking for consistent and secure software management across different Linux distributions, as well as developers who want to maintain a single package for the entire Linux ecosystem.
Step 1: Create an Instance
To get started, create a server instance running Ubuntu 24.04.
- Access the Dashboard: Log in to your Shape.Host account and navigate to your Dashboard.
- Click Create: Click on the “Create” button located in the top-right corner.
- Select Instances: From the dropdown menu, choose “Instances” to begin creating a new cloud server.

- Select Location: Choose a data center location for your instance closest to your target audience for optimal performance.

- Choose a Plan: Scroll through the available pricing plans. Select a plan based on your project requirements, such as Standard, CPU-Optimized, or Memory-Optimized.
- Choose an Image: Select Ubuntu 24.04 as the operating system for your instance.

- Authentication and Finalize: Choose your authentication method, either via SSH keys or password. Once done, click Create Instance to launch your server.

- Obtain IP Address
- Once your instance is created, return to the dashboard.
- Find your instance’s IP address under the Resources section and use it to access your server.

Step 2: Connect to Your Instance
Once your server is up and running, follow these steps to connect to it:
- Get the Instance IP: After creating your instance, find the public IP address in the Shape.Host dashboard under Resources.
- Open SSH Client: Use an SSH client like Terminal (Linux/macOS) or PuTTY (Windows).
- SSH into the Instance: Run the following command in your terminal:
ssh root@<your-instance-ip>
Replace<your-instance-ip>
with the actual IP address of your server. - Enter the Password: If prompted, enter the root password or use your SSH key if it was configured during instance creation.
You are now connected to your instance!
Step 3: Update and Upgrade System Packages
Begin by updating your system to ensure you have the latest packages:
apt update && apt upgrade -y

Step 4: Install Flatpak
Next, install Flatpak using the command:
apt install flatpak -y

Step 5: Add Flathub Repository
Flathub is the official repository of Flatpak applications. You need to add it to your system to start installing Flatpak applications:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Step 6: Update Environment Variables
To properly use Flatpak, update your environment variables by editing the ~/.profile
file:
nano ~/.profile
Add the following lines to the end of the file:
# Add Flatpak paths
if [ -z "${XDG_DATA_DIRS}" ]; then
XDG_DATA_DIRS="/var/lib/flatpak/exports/share:/usr/local/share:/usr/share"
else
XDG_DATA_DIRS="/var/lib/flatpak/exports/share:${XDG_DATA_DIRS}"
fi
export XDG_DATA_DIRS

Save and exit the editor (CTRL + O
to save and CTRL + X
to exit).
Step 7: Apply Changes to Your Profile
To apply the changes made to your .profile
file, run:
source ~/.profile
Verify that the XDG_DATA_DIRS
environment variable is set correctly:
echo $XDG_DATA_DIRS

Step 8: Install GNOME Software Plugin for Flatpak
If you use the GNOME desktop environment, you can install the GNOME Software plugin for Flatpak support:
apt install gnome-software-plugin-flatpak -y

Step 9: Reboot Your System
To ensure all changes take effect, reboot your server:
reboot
Step 10: Using Flatpak
Step 10.1: To install VLC Media Player from the Flathub repository, type the following command in your terminal:
flatpak install flathub org.videolan.VLC

Step 10.2: To search for VLC, you can use the following command:
flatpak search vlc

Step 10.3: If you want to uninstall VLC after it has been installed, type the command below:
flatpak uninstall org.videolan.VLC

If you’re looking for reliable and scalable hosting solutions, consider using Shape.host’s Cloud VPS services. They offer high-performance, fully managed cloud servers that ensure your applications run smoothly and efficiently. Check out Shape.host for more information on their offerings and how they can support your development needs.