"Installing" Godot on Ubuntu

NOTE: done with version 22.04 Jammy-Jellyfish, and could generalize to other Debian based distros.
Updated: August 9th 2024

Hello,
I wanted to write-up a short walk through to setting up the Godot Engine on Ubuntu.

Generally when we download the Godot Engine we get it as a raw binary and not in a deb package that will take care of the installation for us. So most people who are not accustomed to the quirks of a Linux OS will be navigating the file system to just open the Godot Editor. One of the main drawbacks is the path hurdle just to use Godot’s useful CLI.

We can make Godot a real application, and a readily accessible command line tool.

Flatpack way

If you would rather not manage your Godot install manually consider using Flatpack.
See @unit327 post below.

XDG way

Command line Tool setup

Because Ubuntu is XDG compliant we have a hidden folder under each user called .local.

This file path should already be setup, by default, to be accessible to the operating system via the $PATH environment variable. So we will leverage this.

~$ cp Godot_v4.2.1-stable_linux.x86_64 ~/.local/bin/godot
~$ godot --version
4.2.1.stable.official.b09f793f5
thanks to @bexasaurus for the suggestion.
NOTE: ~/.local/bin will only be accessible to the current user. If it needs to be shared with multiple users look to put the executable under ~/.local/share.

Now that we have a location to utilize Godot now lets setup application profile

Application Desktop Profile:

In order to do this we need to add a <app>.desktop file to our ~/.local/share/applications directory.

This file should generally look like this, and can use nano to create it:
file: nano ~/.local/share/applications/godot.desktop

[Desktop Entry]
Name=Godot 4.x Engine
Comment=An open source game engine. Need i say more?
Exec=/home/pennyloafers/.local/bin/godot
Icon=/home/pennyloafers/Godot4/Godot4_icon.png
Terminal=false
Type=Application
StartupNotify=true

you will notice I have an icon Icon=/home/pennyloafers/Godot4/Godot4_icon.png this is important for what you will see when searching and running the application. I modified this one myself by using the default icon found in a newly created project. otherwise you can make it any icon you want!!!

NOTE: there is an XGD way to install an icon under the .local folder. But that will be a TODO for a future update.

There you have it!

If you intend to update Godot on the next release you will have to overwrite the binary under .local/bin.

Let me know what you think and please share improvements, if you want a Windows version let me know!

Thanks for looking!

9 Likes

I like this, very nice write-up! :+1:

I actually use a slightly different setup, probably a bit less new-Linux-user-friendly but I’ll quickly summarize it. First, I have a directory, ~/.local/bin which is first in my $PATH (so anything looking will look there first), then I copy the Godot executable, with version number etc, in to that directory. (Doesn’t actually need to be there, ~/.local/share/godot would probably be better. I should change this come to thing about it…) Lastly I create a symlink at ~/.local/bin/godot that points to the “numbered executable”.

Same setup with the .desktop-file, with different paths of course.

2 Likes

I like this suggestion, and I should probably look into understanding this .local folder more.

Thank you!

I hope in the future Godot produces an installation package.

2 Likes

Hmm… I doubt they will provide an installation package, considering how many different ways you need to do that for Linux alone.

But I suspect this is an excellent first package to set up in your favourite package system, if you are willing to maintain it, of course! :wink: (I know Debian has a few Godot 3-packages, but not sure how well-maintained they are. Might be a starting point since Ubuntu uses Debian’s package system?)

1 Like

Someone has made an unofficial flatpak Install Godot on Linux | Flathub

1 Like

Sure, although I would rather have it come from a trusted source, and, since Ubuntu has chosen Snap as their alternative package manager, I also don’t want to make this an other app installation guide.

I’m a believer in use what you got until it doesn’t work for you. And I cringe every time a need to add a new package repository to apt. But I will do it if I need the app.

I had an office mate that would seeth through his teeth every time he heard about Snap problems, saying some strong words before talking about Flatpack as the answer.

I haven’t personally used flatpack, but doing a quick search it seemed like it is XDG compliant at least. Which @bexasaurus made me realize about what the .local folder is used for in a users home directory, and I plan to update the guide to go the manual XDG route.

Although going down this path may alienate some non-XDG desktops, and distros that use said desktops, I want to constrain the scope of this guide.

@bexasaurus, the prospect of maintaining a package seems interesting, but I don’t want the commitment :smile:

If you use discord, every time it needs an update the app will download a deb for you and a quick dpkg command later it’s installed, that is what I would prefer at the least. And I think the Godot build system could be updated to create the major distro package archives for Debian and what ever the red hat one is, for cheap? … That is something I would be more interested in working towards personally.

Thanks for pointing that out regardless!

I’m with your colleague; down with snaps, all hail flatpak and appimage!

If I were the godot devs I’d stay well away from providing distro packages. Too much fragmentation and maintenance burden, let them focus on making a great game engine and let the community package it. Arch for example has a godot package in the main repo.

The other option is installing godot via steam.

1 Like

I am new to godot and game developement. I followed your steps and alias godot=‘path’ and works really great, thanks,

Any idea how can i open it from terminal making it independent on terminal, by independent i mean godot engine keep running even if i close terminal.

I tried

godot &
godot --no-window-server &

but godot engine closes when i close terminal

launch it by using “nohup” command.
so: nohup godot

.b

2 Likes

it worked but had to add & at end not sure why,

nohup /opt/Godot/Godot-V4.2.2 &

Thanks @b52

I would expect using & would work. Although to be honest I don’t think I ever tried to do that,I usually leave my terminal running.

But I learned something new about the differences of nohup and &

Also I guess you could maybe skip the alias if we put the executable into .local/bin where it will be picked up in the PATH variable.

Sigmas:

open terminal
./godot

2 Likes

For those who are interested, I made a bash script that automates what @pennyloafers did. the post is here.
Thank you!