The aim of this guide is to simplify the configuration process and teach a little bit about the command line. It is only ten steps! Of course, this could be boiled down to a two-liner with some CLI wizardry, but that is not the point.
Follow the directions in order. Copy and paste the code, or better yet, type it out for an improved learning experience.
This guide applies to all flavors of Ubuntu 24.04 LTS Noble Numbat x86-64.
Also, PAY CLOSE ATTENTION when to use “sudo”.
Much thanks goes out to the GrapheneOS team for all their hard work.
1) Install the main build tools with this command:
sudo apt install python3 git gnupg openssh-client diffutils fontconfig inetutils-* net-tools openssl rsync unzip zip gperf gcc-multilib g++-multilib htop curl repo yarnpkg python-is-python3 python3-protobuf protobuf-compiler
The version of repo in the Ubuntu repositories is out of date. Run the following three commands to replace it with the latest version:
curl https://storage.googleapis.com/git-repo-downloads/repo > repo
sudo chmod a+rx repo
sudo mv repo /usr/bin/repo
2) “nvm” is node version manager, needed to install version 24 since this package is also out of date. The next command will grab it:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
3) Install the node LTS version using nvm:
nvm install --lts
nvm alias default 24.14.0
4) Use a favorite text editor to open ~/.bashrc (or equivalent) – nano is easy to use:
nano ~/.bashrc
At the very bottom (use the Page Down key) paste this to a new line:
export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Source it:
source ~/.bashrc
5) Now edit /etc/sysctl.conf:
sudo nano /etc/sysctl.conf
At the very bottom (use the Page Down key) paste the following new lines:
kernel.unprivileged_userns_clone=1
kernel.apparmor_restrict_unprivileged_userns=0
vm.swappiness = 1
fs.inotify.max_user_watches = 524288
Save it and exit back to a prompt. At this point, either restart the computer or restart systemd-sysctl.service for the changes to be reflected.
sudo systemctl restart systemd-sysctl.service
6) Configure git with a user name and email.
git config --global user.name "user"
git config --global user.email "user@user.com"
7) In the terminal, make a folder to download the GrapheneOS source code. The commands below will keep it in the home directory, but if limited on space, create it somewhere else. Faster is better, i.e. NVMe would be best, USB (even Type-C) will be comparatively slow. Here we go:
mkdir ~/grapheneos
cd ~/grapheneos
8) Now initialize the repo. For the purposes of this tutorial, here’s the command for GrapheneOS stable tag 2026030100 :
repo init --depth=1 -u https://github.com/GrapheneOS/platform_manifest.git -b refs/tags/2026030100
9) Time to fetch the source, many gigabytes of downloading await. Don’t worry, it’s automated.
repo sync -cq
Check back periodically. It all depends on the speed of the internet connection.
10) Configure udev rules for fastboot/adb access to Pixel devices. Create a new file:
sudo nano /etc/udev/rules.d/51-android.rules
Paste the following line:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
Save it and exit.
That is it! Everything should be ready to build.
Donate to the new hardware fund here. Thanks for reading!