NOTE: done with version 22.04 Jammy-Jellyfish, and could generalize to other Debian based distros.
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.
Command line Tool setup
First we need to manage where the Godot binary should reside. We can copy a version into the /usr/bin path as godot. This will place it under a default search path for any terminal to find.
~$ cp Godot_v4.2.1-stable_linux.x86_64 /usr/bin/godot
~$ godot --version
4.2.1.stable.official.b09f793f5
WARNING: This could potentially be dangerous if you accidentally name it to a file that already exists overwriting it in the process.
The safer alternative is an alias.
~$ alias godot=Godot_v4.2.1-stable_linux.x86_64
~$ godot --version
4.2.1.stable.official.b09f793f5
But this change is temporary, and when you open a new terminal the alias will not exist. So we can setup our bash profile to automatically perform the alias command any time we open a new terminal.
open the bash profile inside the users home directory.
~$ nano ~/.bashrc
# add the line, ctrl+x to exit, will be prompted to save
# reload the profile and test
~$ source ~/.bashrc
~$ godot --version
4.2.1.stable.official.b09f793f5
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/Godot4/Godot_v4.2.1-stable_linux.x86_64
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!!!
There you have it. If you intend to update Godot on the next release you will have to go and modify the alias and the desktop file each time to point at the newest version. To make this process a little easier you can designate a special path that the alias and .desktop file will target. Then with either over-writing the binary with a new version of the same name (using cp
command) or using a symbolic link pointing to the real version you want to run.
Let me know what you think and please share improvements, if you want a Windows version let me know, I tend to work on all major operating systems.
Thanks for looking!