How to Install i3 Linux [2 Best Methods]

TL;DR

Follow these steps to install i3 Linux and configure it:

  1. Update your system by running sudo apt update followed by sudo apt upgrade to ensure all packages are current.
  2. Install the i3 window manager with the command sudo apt install i3.
  3. Log out and at the login screen, select i3 from the session options to start using it.
  4. Customize your i3 settings by editing the configuration file using nano ~/.config/i3/config, where you can adjust keybindings, appearance, and more.
  5. Apply and activate configuration changes in i3 without restarting by pressing Mod+Shift+R.

Check out the guide below for detailed steps on how to install i3 Linux, along with tips for managing i3 and troubleshooting common installation errors.

Switching to a new window manager can seem challenging, especially if you’re used to the default options. If you’re looking for a way to maximize screen space and boost productivity, i3 might be the perfect fit. In this post, I will guide you through installing i3 on Ubuntu and configuring it, troubleshooting common issues, and keeping your i3 setup running smoothly. By the end, you’ll have a streamlined, efficient desktop environment that suits your workflow perfectly.

What is i3?

i3 is a tiling window manager for Linux. Unlike traditional window managers, which stack windows on top of each other, i3 arranges windows in a grid. This means you can see and manage multiple applications on your screen at once without overlapping windows. It’s lightweight, fast, and highly customizable, making it a favorite among advanced users and those who prefer keyboard shortcuts over mouse-driven interfaces.

Why Choose i3 Over Other Window Managers?

Choosing i3 over other window managers offers several advantages:

  • Efficiency: i3 uses tiling to organize windows, which maximizes screen space and allows you to work more efficiently. You can see all your open applications at a glance without needing to switch between them.
  • Customization: You can configure i3 to suit your workflow perfectly. From keybindings to window rules, you have complete control over how i3 behaves.
  • Performance: i3 is very lightweight. It uses minimal system resources, which makes it ideal for older computers or systems with limited hardware capabilities.
  • Keyboard-Driven: i3 emphasizes keyboard usage. You can manage your entire desktop without touching the mouse, which can speed up your workflow once you get used to the shortcuts.

How to Install i3 Linux

For i3 configure, start by updating your package list with sudo apt update and then install i3 using sudo apt install i3 for Debian-based systems like Ubuntu. For a cleaner install, use Snap with sudo apt install snapd and then sudo snap install i3. Alternatively, compile from source by installing dependencies, cloning the i3 repository, and running make followed by sudo make install.

Here are the detailed steps for each method to ubuntu i3 install:

1. Installing i3 from Source

Installing i3 from source is more complex but gives you control over the installation process and allows for custom configurations. This method is ideal for advanced users who need specific features or custom setups. Follow these steps to install i3 Linux:

  1. Install the necessary dependencies required to compile i3 from source.
sudo apt update

sudo apt install git gcc make pkg-config libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf libxcb-xrm0 libxcb-xrm-dev automake
installing neccessary dependencies
  1. Clone the official i3 repository from GitHub.
git clone https://github.com/i3/i3

cd i3
cloning official i3 repository
  1. Compile the source code and install i3 Linux.
ninja -C build

sudo ninja -C build install
compiling source code and installing i3
  1. Check the installed version to ensure i3 is properly installed.
i3 --version
verifying the installation

2. Install i3 using APT Package Manager

Installing i3 using the APT package manager is the most straightforward and commonly used method for Ubuntu. This method ensures that you get a stable version of i3 from the official Ubuntu repositories, making the installation process simple and reliable. Follow these steps to install i3 Linux:

  1. Open your Terminal window.
open terminal
  1. Before installing any new software, it’s crucial to update your system to make sure all existing packages are current. Type the following command:
sudo apt update

This command will fetch the list of available updates for your system’s packages.

updating system packages
  1. Next, proceed with upgrading your packages by executing:
sudo apt upgrade

This command will download and apply updates, ensuring your system is fully up-to-date.

upgrading packages to the latest version
  1. Once your system is updated, you can install the i3 window manager. In your terminal, run the following command:
sudo apt install i3

This command installs i3 along with the necessary dependencies and default configuration files.

installing i3 window manager on ubuntu

How to Configure i3 on Ubuntu

To configure i3 on Ubuntu, log into the i3 session and run the initial setup wizard, which helps you create a basic configuration file. Choose your preferred Mod key (typically the Alt or Windows key) during setup. Customize your setup by editing the ~/.config/i3/config file using a text editor like Nano. Here, you can define keybindings, window behavior, colors, and status bar settings. Reload i3 with Mod+Shift+R to apply changes without restarting your session.

  1. After installation, log out of your current desktop session. 
log out from current desktop session
  1. At the login screen, click the session chooser (usually a gear icon) and select i3 from the list of available window managers. 
select i3 from login screen
  1. Log in as usual.
logging to user
  1. Upon logging into i3 for the first time, a configuration wizard will appear to help you create your initial configuration file. It will ask if you want to generate a configuration file:
generating configuration file
  1. Then select which key you prefer as your Mod key (typically the Alt or Windows key). Choose your options and proceed.
choosing mod key

Here are some basic commands to get you started navigating in i3:

  1. To open a Terminal, press Mod+Enter (Mod is the key you chose during setup, either Alt or Windows).
opening terminal in i3
  1. To close a window, press Mod+Shift+Q.
closing terminal in i3
  1. To change focus between windows, use Mod+Arrow keys (up, down, left, right).
toggle between terminal windows in i3
  1. To split windows horizontally, press Mod+H:
split terminal window horizontally
  1. To split windows vertically press Mod+V:
split terminal window vertically
  1. To toggle fullscreen mode for a window, press Mod+F.
toggle full screen in i3 window manager
  1. To personalize your i3 setup, you’ll want to edit the configuration file. Open this file in a text editor; for example, you can use Nano:
nano ~/.config/i3/config

The configuration file will open in Nano editor.

opening i3 configuration file in nano editor
  1. Here, you can start customizing shortcuts, window behavior, colors, status bar settings, and more. For instance, to change the default Mod key to the Windows key, find the line that starts with set $mod and change it to:
set $mod Mod4

After execution the command will change the default Mod key to Windows key.

changing mod key in configuration file
  1. After making changes to your configuration, you can reload i3 without restarting your session to apply these changes. To do this, press Mod+Shift+R.
reloading session to apply changes

4 Tips to Keep Your i3 Window Manager Smooth and Efficient

Keeping your i3 window manager running smoothly involves regular maintenance and some tweaks. Here are four routine tips to help ensure that your i3 environment remains efficient and responsive:

  • 🔄 Regularly Update Your System: Frequently update your Linux distribution and i3 with sudo apt update && sudo apt upgrade. This enhances system security, ensures software compatibility, and improves stability and performance, providing an optimal computing environment.
  • 🧹 Clean Up Configuration Files: Regularly review and declutter your ~/.config/i3/config files. Removing outdated or unused configurations speeds up startup times and simplifies system management, making it easier to troubleshoot issues.
  • 🔍 Monitor System Resources: Use tools like htop or conky to monitor CPU and memory usage. Identifying and managing resource-heavy processes ensures smooth operation of your i3 environment, prevents slowdowns, and aids in making informed decisions about system upgrades and optimization.
  • 🔄 Backup Important Files: Ensure the safety of your i3 settings and scripts with regular backups using tools like rsync or tar. For instance, back up your configuration directory with tar -czvf i3-config-backup.tar.gz ~/.config/i3/ and store it securely, allowing quick recovery if problems arise.

Troubleshooting Common i3 Installation Issues

After installing the i3 window manager, you might encounter some common issues. Addressing these effectively ensures a smoother experience. Here’s a quick guide to four most typical problems and their solutions:

  • 🖥️ No Login Option for i3: Sometimes, i3 might not appear as an option on your login screen after installation. This usually means the installation didn’t integrate i3 into your display manager. To fix this, in Terminal type sudo apt install --reinstall i3. This command reinstalls i3 and usually resolves the issue by correctly registering it with your display manager.
  • ⌨️ Key Bindings Not Working: If you find that your keyboard shortcuts or key bindings are not responding, there might be errors in your configuration file. Open your ~/.config/i3/config file in a text editor like Nano by typing nano ~/.config/i3/config. Check for any syntax errors or incorrect commands. Ensure that the Mod key (usually Alt or Windows key) is defined correctly at the top of the file and that none of the bindings are overlapping or conflicting with each other.
  • 🔊 No Sound: If you don’t hear any sound after installing i3, you may need to install or configure your sound manager. Open your Terminal and install pulseaudio and pavucontrol by typing sudo apt install pulseaudio pavucontrol. These applications manage your sound settings. After installation, reboot your system or restart i3 to initialize PulseAudio, which should resolve most sound issues.
  • 📺 Dual Monitors Not Configured: Setting up multiple monitors can be tricky in i3. First, check your monitor configuration by typing xrandr in your Terminal. This command displays all connected monitors and their statuses. To configure your monitors manually, use xrandr to activate and set the position of each monitor.

Install i3 Ubuntu: Summing Up

In this article, I provided a step-by-step guide to installing and configuring i3 on Ubuntu. I have covered methods using APT and source installation, as well as troubleshooting common errors. I also included tips to keep your i3 window manager running smoothly, ensuring an efficient and customized setup for your Linux system.

If you found this guide helpful, consider exploring related topics:

  • Learn how to resolve the “You Have Held Broken Packages” error to fix installation issues.
  • Discover ways to create desktop shortcuts on Ubuntu for a more efficient workflow.
  • Explore installing the GNOME Desktop Environment on Linux to manage multiple environments.

Frequently Asked Questions

  1. What is the apt update command?

    The apt update command is used in Debian-based Linux distributions to update the list of available packages and their versions from the configured sources. It does not install or upgrade any packages, but it refreshes the local package index files, ensuring that when you use commands like apt upgrade, the system knows about the latest versions of packages and their dependencies available for installation. This command is a crucial first step in maintaining system software through the APT (Advanced Package Tool) package management system.

  2. What is the apt upgrade command?

    The apt upgrade command in Linux is used to upgrade all the installed packages on your system to their latest versions. This command checks the package repositories for new versions of packages that are currently installed on your system and updates them. It is important to run apt update before apt upgrade to ensure that the package lists from the repositories are up to date. apt upgrade will not remove any packages or install new ones that are not already installed; it only upgrades the existing packages.

  3. How can I revert back to my previous window manager if i3 does not meet my expectations?

    To switch back to your previous window manager from i3, log out of i3, then select your preferred window manager from the session options on the login screen. This change will take effect immediately when you log back in.

  4. How do I restore i3 settings after a system crash?

    If your system crashes and you need to restore your i3 settings, reinstall i3 if necessary and replace the configuration file in ~/.config/i3/config with a backup. If you don’t have a backup, you’ll need to recreate your configuration based on your preferences.

  5. How do I update i3 without losing my current configuration?

    To update i3 while keeping your existing settings intact, run sudo apt update and sudo apt install i3 to get the latest version. Your configuration files in ~/.config/i3/ won’t be affected by this process, ensuring your setup remains unchanged.

Ojash

Author

Ojash is a skilled Linux expert and tech writer with over a decade of experience. He has extensive knowledge of Linux's file system, command-line interface, and software installations. Ojash is also an expert in shell scripting and automation, with experience in Bash, Python, and Perl. He has published numerous articles on Linux in various online publications, making him a valuable resource for both seasoned Linux users and beginners. Ojash is also an active member of the Linux community and participates in Linux forums.

Akshat

Reviewer

Akshat is a software engineer, product designer and the co-founder of Scrutify. He's an experienced Linux professional and the senior editor of this blog. He is also an open-source contributor to many projects on Github and has written several technical guides on Linux. Apart from that, he’s also actively sharing his ideas and tutorials on Medium and Attirer. As the editor of this blog, Akshat brings his wealth of knowledge and experience to provide readers with valuable insights and advice on a wide range of Linux-related topics.

Share this article
Shareable URL
Prev Post

3 Effective Methods to List Files Recursively in Linux

Next Post

5 Best Ways to Use Cat EOF for Multi-line Strings in Bash

Leave a Reply

Your email address will not be published. Required fields are marked *

Read next