Stay organized with collections
Save and categorize content based on your preferences.
These instructions explain how to set up Cobalt for your workstation and your
Raspberry Pi device. They have been tested with Ubuntu:20.04 and a Raspberry Pi
3 Model B.
After flashing your device, you'll still need to setup your wifi. Login with the
default pi login, and run sudo raspi-config. You'll find wifi settings under
1. System Options, then S1 Wireless LAN.
Set up your workstation
The following steps install the cross-compiling toolchain on your workstation.
The toolchain runs on an x86 workstation and compiles binaries for your ARM
Raspberry Pi.
Run the following command to install packages needed to build and run
Cobalt for Raspberry Pi:
The rsyncs get somewhat faster after the first time, as rsync is good at
doing the minimum necessary effort.
Even if you have a keyboard hooked up to the RasPi, you should SSH
into the device to run Cobalt. Using SSH will make it easy for you
to quit or restart Cobalt.
With this approach, you can just hit [CTRL-C] to close Cobalt. If you
were to run it from the console, you would have no way to quit without
SSHing into the device and killing the Cobalt process by its PID.
Note that you can also exit YouTube on Cobalt by hitting the [Esc] key
enough times to bring up the "Do you want to quit YouTube?" dialog and
selecting "yes".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eThis document provides instructions for setting up Cobalt on a workstation and a Raspberry Pi device, specifically tested with Ubuntu:20.04 and a Raspberry Pi 3 Model B.\u003c/p\u003e\n"],["\u003cp\u003eSetting up the Raspberry Pi involves downloading a customized Raspbian image, flashing it onto an SD card using a tool like balenaEtcher or \u003ccode\u003edd\u003c/code\u003e, and configuring the WiFi settings via \u003ccode\u003esudo raspi-config\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eWorkstation setup requires installing a cross-compiling toolchain for ARM Raspberry Pi, setting the \u003ccode\u003e$RASPI_HOME\u003c/code\u003e environment variable, and adding it to the \u003ccode\u003e.bashrc\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eBuilding and installing Cobalt on the Raspberry Pi involves running \u003ccode\u003egn.py\u003c/code\u003e, compiling with \u003ccode\u003eninja\u003c/code\u003e, and using \u003ccode\u003ersync\u003c/code\u003e to transfer the compiled binaries to the device.\u003c/p\u003e\n"],["\u003cp\u003eCobalt should be run on the Raspberry Pi via SSH, allowing for easy quitting or restarting using \u003ccode\u003e[CTRL-C]\u003c/code\u003e or by exiting through the in-app dialog.\u003c/p\u003e\n"]]],["To set up Cobalt, download the Raspbian image and use a flashing tool (balenaEtcher on MacOS, `dd` on Linux) to write it to an SD card. Configure Wi-Fi via `sudo raspi-config`. On your workstation, install necessary packages (`g++-multilib`, etc.), set `$RASPI_HOME`, download the toolchain, and extract it. Build Cobalt with `gn.py` and `ninja`, then use `rsync` to install the binary on the Raspberry Pi. SSH into the Pi and run `cobalt_loader` to start Cobalt.\n"],null,["These instructions explain how to set up Cobalt for your workstation and your\nRaspberry Pi device. They have been tested with Ubuntu:20.04 and a Raspberry Pi\n3 Model B.\n\nSet up your device\n\nDownload the latest Cobalt customized Raspbian image from [GCS bucket](https://storage.googleapis.com/cobalt-static-storage-public/2020-02-13-raspbian-buster-lite_shrunk_20210427.img)\n(this is built via [this\ncustomization tool](https://github.com/youtube/cobalt/tree/main/cobalt/tools/raspi_image))\n\nOn MacOS, use an image flashing tool like [balenaEtcher](https://www.balena.io/etcher/) to write the image to a 32GB SD-card.\n\nOn Linux, follow the steps below.\n\nCheck the location of your SD card (/dev/sdX or /dev/mmcblkX) \n\n $ sudo fdisk -l\n\nMake sure the card isn't mounted ( `umount /dev/sdX` ).\n\nCopy the downloaded image to your SD card (the disk, not the partition. E.g. /dev/sdX or /dev/mmcblkX): \n\n $ sudo dd bs=4M if=2020-02-13-raspbian-buster-lite_shrunk_20210427.img of=/dev/sdX\n\nAfter flashing your device, you'll still need to setup your wifi. Login with the\ndefault pi login, and run `sudo raspi-config`. You'll find wifi settings under\n`1. System Options`, then `S1 Wireless LAN`.\n\nSet up your workstation **Note:** Before proceeding further, refer to the documentation for [\"Set up your environment - Linux\"](/youtube/cobalt/docs/development/setup-linux). Complete the sections **Set up your workstation** and **Set up developer tools**, then return and complete the following steps.\n\nThe following steps install the cross-compiling toolchain on your workstation.\nThe toolchain runs on an x86 workstation and compiles binaries for your ARM\nRaspberry Pi.\n\n1. Run the following command to install packages needed to build and run\n Cobalt for Raspberry Pi:\n\n $ sudo apt install -qqy --no-install-recommends g++-multilib \\\n wget xz-utils libxml2 binutils-aarch64-linux-gnu \\\n binutils-arm-linux-gnueabi libglib2.0-dev\n\n2. Choose a location for the installed toolchain -- e.g. `raspi-tools`\n -- and set `$RASPI_HOME` to that location.\n\n3. Add `$RASPI_HOME` to your `.bashrc` (or equivalent).\n\n4. Create the directory for the installed toolchain and go to it:\n\n $ mkdir -p $RASPI_HOME\n $ cd $RASPI_HOME\n\n5. Download the pre-packaged toolchain and extract it in `$RASPI_HOME`.\n\n $ curl -O https://storage.googleapis.com/cobalt-static-storage-public/cobalt_raspi_tools.tar.bz2\n $ tar xvpf cobalt_raspi_tools.tar.bz2\n\n (This is a combination of old raspi tools and a newer one from linaro\n to support older Raspbian Jessie and newer Raspbian Buster)\n\nBuild, install, and run Cobalt for Raspberry Pi\n\n1. Build the code by navigating to the `cobalt` directory and run the\n following command:\n\n $ cobalt/build/gn.py -p raspi-2 -C devel\n\n2. Compile the code from the `cobalt/` directory:\n\n $ ninja -C out/raspi-2_devel cobalt_install\n\n3. Run the following command to install your Cobalt binary (and content)\n on the device:\n\n $ rsync -avzLPh --exclude=\"obj*\" --exclude=\"gen/\" \\\n $COBALT_SRC/out/raspi-2_devel pi@$RASPI_ADDR:~/\n\n The `rsyncs` get somewhat faster after the first time, as `rsync` is good at\n doing the minimum necessary effort.\n4. Even if you have a keyboard hooked up to the RasPi, you should SSH\n into the device to run Cobalt. Using SSH will make it easy for you\n to quit or restart Cobalt.\n\n $ ssh pi@$RASPI_ADDR\n $ cd raspi-2_devel/install/cobalt_loader\n $ ./cobalt_loader\n\n With this approach, you can just hit `[CTRL-C]` to close Cobalt. If you\n were to run it from the console, you would have no way to quit without\n SSHing into the device and killing the Cobalt process by its PID.\n\n Note that you can also exit YouTube on Cobalt by hitting the `[Esc]` key\n enough times to bring up the \"Do you want to quit YouTube?\" dialog and\n selecting \"yes\"."]]