Posted on
Ghostty terminal mascot in ASCII art

Ghostty is finally out. I already tried it on my MacBook and the installation process went super smooth, thanks to Homebrew.

But when I tried to install it on my Ubuntu laptop, I realized that there was no package available for Ubuntu. So I decided to build it from source.

The documentation is pretty straightforward but turns out that I did find some problems when running the application, mainly because of some specific configurations I had, so I'm writing this post in case it helps anyone else with the same configurations/issues.

Building from source

First you need to clone the repository:

git clone git@github.com:ghostty-org/ghostty.git

Then, as stated in the documentation, you need to install zig, the programming language in which Ghostty is written:

snap install zip --classic --beta

Then the dependencies:

sudo apt install libgtk-4-dev libadwaita-1-dev git

And finally the build command:

zig build -p $HOME/.local -Doptimize=ReleaseFast

This should work fine and after the build is finished you should have a ghostty binary in your ~/.local/bin folder.

Now you just need to run the following command so that Gnome updates the application launcher with Ghostty:

sudo update-desktop-database

Environment problem

This is the part where I ran into my first error. I was using Alacritty and tried to run Ghostty from the terminal. Ghostty partially opened but failed to render the UI with the following error:

ERROR: could not initialize EGL display

This turned out to be a problem with the environment variables defined in Alacritty. I don't fully grasp the problem, but let's just say that right after I tried the same with Gnome Terminal and it worked with no issues.

PATH problem

Second problem I had was that even after running update-desktop-database, Gnome launcher didn't pick up the Ghostty application. Also the ghostty bin was not in my PATH. So clearly the problem was on my setup.

After some investigation I realized that I had a .profile in my $HOME directory, but since I had changed the default system shell to zsh it was not being picked up. Renaming to .zprofile and logging out/in fixed it.

For completeness, here's what you should have in your shell profile for this to work:

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

Final thoughts

Even after these minor issues, building Ghostty was pretty much straightforward. I did it because I'm already using it on MacOS and I wanted to check out how it compares to the Linux version, while I wait for a package to come out. Maybe I'll write a review later after a couple of weeks using it. For now it's pretty good and will probably replace Alacritty as my go to terminal.