What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Yes—you can compile Android on an Ubuntu VPS, but a current build is a workstation-scale workload rather than a small cloud instance. For current AOSP guidance, budget a 64-bit x86 server with at least 64 GB of RAM and 400 GB of free persistent disk. A device ROM such as LineageOS also needs a matching device tree, kernel, vendor files, branch, Java/Python toolchain, and the device project’s preparation steps. The reliable workflow is to identify the device codename and ROM branch first, size the VPS for that combination, then follow the branch’s documented repo, breakfast, and brunch sequence.

What you are actually building

“Android ROM” can mean two different jobs. A generic Android Open Source Project (AOSP) build produces platform images for a defined build target. A flashable build for a named phone or tablet is a device-integration project: the platform source must be combined with a device tree, kernel source, hardware configuration, proprietary vendor blobs, and the ROM project’s signing and packaging rules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A VPS is suitable because both workflows are 64-bit Linux command-line processes. It does not remove hardware or licensing constraints. Your server still needs enough memory for parallel compilers, fast persistent storage for the source and out/ directories, and a network connection capable of downloading a very large manifest. The device’s official build page remains authoritative for supported branches, required blobs, and target-specific commands.

Choose AOSP or a device ROM before renting the server

Decision point Generic AOSP LineageOS or another device ROM
Purpose Platform development, framework work, emulator or reference targets. A flashable image for a particular phone or tablet.
Source and manifest Google’s platform manifest; branch names change over time. The ROM project’s manifest plus device-specific repositories.
Device integration Not necessarily tied to a commercial device. Requires a supported codename, device tree, kernel and vendor components.
Toolchain Packages and JDK requirements depend on the selected AOSP branch. Branch and device guides specify Java, Python and extra utilities; LineageOS 18.1 and newer use OpenJDK 11 included with the source download, while older branches can require different combinations.
Failure most likely to block progress Insufficient disk, RAM or an incompatible host package set. Unsupported branch/codename pairing or missing proprietary files, even when compilation tools are correct.
Update and reproducibility Pin a manifest branch and record the revision used for each build. Follow the device page’s branch and vendor-blob revisions; device support can change independently of the platform.

If your goal is a usable image for one named device, start with that device’s LineageOS (or other ROM) page rather than checking out plain AOSP. If your goal is framework experimentation, AOSP is the simpler and more reproducible target.

#1 Best Overall
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

VPS capacity: current minimums and practical headroom

The current AOSP requirements guidance calls for a 64-bit x86 environment, at least 400 GB of free disk space and at least 64 GB of RAM. Google breaks the storage figure into approximately 250 GB to check out the source and 150 GB to build it. Those are minimums for the current development workflow, not a promise that every branch or device build will fit exactly.

Resource Current AOSP guidance What to budget for a device ROM
Architecture 64-bit x86 Linux. Use a 64-bit x86 Ubuntu VPS; modern branches are not sized for 32-bit systems.
Free disk At least 400 GB (about 250 GB checkout plus 150 GB build output). Add ccache, additional devices, local patches, logs and temporary extraction space. Mirrors and multiple builds need more than 400 GB.
Memory At least 64 GB RAM. Keep the same floor for a LineageOS build and reduce parallel jobs if the device tree or compiler causes swapping.
CPU No universal core count is specified. More cores shorten builds only when storage and RAM keep up; start conservatively with the VPS’s actual CPU and tune.
Storage type Persistent free space is required. Prefer persistent block storage with good random I/O. Ephemeral disks risk losing a multi-hour checkout or build.

Google reports using 72-core machines with 64 GB of RAM and about 40 minutes for a full build. That is Google’s reference hardware, not a VPS performance guarantee. Provider CPU models, storage latency, network throughput, branch size and proprietary dependencies can make a remote build substantially slower.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An older AOSP environment page mentions virtual machines with 16 GB of RAM (including swap) and 30 GB of disk. Those figures describe old branches and much smaller source trees; do not use them to size an Android 11-or-newer or latest-release VPS.

Account for ccache and parallel checkouts

Every device build consumes the checked-out source, the out/ directory and any compiler cache on the same volume. A 50 GB ccache setting therefore raises the disk requirement by up to 50 GB; it does not replace the 400 GB source-and-build allowance. If you build several devices with distinct kernels, plan additional cache and output space rather than assuming one device’s footprint will be reused.

Rank #2
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to | Prepaid Smartphone- 6.6" 120Hz Display, 5G , 50MP Quad Pixel Camera, Long-Lasting Battery
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.

Prepare a secure Ubuntu VPS

For Android 11 and later, AOSP says to use Ubuntu 18.04 or later. A newer LTS release may be convenient, but the selected ROM branch can impose a narrower package, Python or JDK range. Confirm the branch requirements before choosing an image; changing Ubuntu after a large checkout is expensive.

Set up the host and build account

  • Choose a 64-bit x86 Ubuntu image with a persistent data volume large enough for source, output and cache.
  • Create an unprivileged build account. Use sudo only for package installation and system configuration.
  • Install an SSH key and disable password login if your provider permits it. Long builds should run inside tmux or screen so a dropped connection does not terminate the shell.
  • Check the provider’s interruption, reboot and snapshot policies. Keep manifests, local patches and build logs backed up outside the VPS.
  • Reserve swap only as a safety net. Swapping heavily is a sign that compiler concurrency is too high, not a substitute for 64 GB of RAM.

Install the AOSP host packages

After logging in as the build user, update Ubuntu and install the package set from the versioned AOSP instructions:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo apt-get update
sudo apt-get install git-core gnupg flex bison build-essential zip curl 
  zlib1g-dev libc6-dev-i386 x11proto-core-dev libx11-dev lib32z1-dev 
  libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig

Do not copy a package list from an old blog post without checking the branch. Android build prerequisites change as the source tree and host tools change. If you are building LineageOS, install the additional utilities named by its device guide, commonly including bc, ccache, git-lfs, image and filesystem tools, protobuf tooling, rsync, schedtool, squashfs-tools and xxd, along with the multilib libraries and the AOSP packages above.

Fetch and prepare AOSP

The following sequence follows the current AOSP getting-started shape. The branch name is deliberately explicit: branch aliases change, so record the one used for a reproducible build.

Rank #3
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
  1. Create a workspace.
    mkdir -p ~/aosp && cd ~/aosp
  2. Initialize the manifest. Use the current platform manifest and the selected branch:
    repo init --partial-clone -b android-latest-release 
      -u https://android.googlesource.com/platform/manifest

    When repo asks, set a real Git name and email. The manifest URL above is Google’s platform source entry point; pin a different documented branch when your project requires one.

  3. Synchronize source.
    repo sync -c -j8

    The -j8 value is an example from the documentation, not a universal optimum. Increase it only when CPU, RAM, disk I/O and network capacity remain comfortable; decrease it if the VPS starts swapping or the provider throttles it.

  4. Load the build environment.
    source build/envsetup.sh

    This adds the build helper functions to the current shell. Run it again in every new shell that will invoke Android build commands.

A generic AOSP build then requires selecting a valid product and variant for the checked-out branch before invoking the branch’s documented build command. Do not copy a target name from another release: products, lunch targets and required host tools are branch-specific. Keep the manifest revision and the exact target in your build notes.

Build a device-specific ROM with LineageOS

For a phone or tablet, begin at the official device build page and identify three values before running commands: the LineageOS branch, the device codename and whether the page requires a matching installed build or proprietary-file extraction. A model’s marketing name is not a valid substitute for its codename.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Initialize the LineageOS source tree

  1. Create the workspace.
    mkdir -p ~/android/lineage
    cd ~/android/lineage
  2. Initialize the exact branch. Replace <lineage-branch> with the branch named by the device page:
    repo init -u https://github.com/LineageOS/android.git 
      -b <lineage-branch> --git-lfs --no-clone-bundle

    The --git-lfs option fetches Git LFS content used by the tree; --no-clone-bundle avoids the deprecated clone-bundle path.

  3. Synchronize repositories.
    repo sync

    A device tree can pull many repositories. Confirm free space before starting and again after synchronization.

  4. Load build helpers.
    source build/envsetup.sh
  5. Prepare the device. Substitute the codename exactly as written on the device page:
    breakfast <device-codename>

    breakfast prepares device-specific repositories and configuration. A failure here commonly means that the branch and codename are not a supported pair, or that a required repository was not fetched.

  6. Start the build.
    brunch <device-codename>

    brunch selects the prepared target and starts compilation. Keep the terminal inside tmux or screen, and save the complete log.

Handle proprietary files

Many devices refer to firmware and vendor libraries that are not present in the public source tree. The device page may require extracting blobs from a particular factory image or from a previously installed, matching LineageOS build. Use only the extraction procedure and source version documented for that device. A successful repo sync does not prove that all proprietary files are present; missing blobs typically appear later as build-time errors or as a non-booting image.

Match Java and Python to the branch

Java and Python requirements are not interchangeable across LineageOS branches. The current LineageOS guidance states that 18.1 and newer use OpenJDK 11 included with the source download; older branches can require different JDK and Python combinations that a current Ubuntu release does not install by default. Select the versions named by the branch guide, verify them with java -version and python3 --version, and do not “fix” a version error by globally replacing the system interpreter used by Ubuntu.

Rank #4
Sale
Samsung Galaxy S26 Ultra, Unlocked Android Smartphone, 512GB, Black | Privacy Display, Galaxy AI, AI Camera, Super Fast Charging 3.0, Durable Battery, 2026, US 1 Year Warranty
  • PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
  • TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
  • NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
  • MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
  • HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone

Use ccache for repeat builds

Compiler caching is valuable when you rebuild after changing a patch, device configuration or kernel. LineageOS documents this setup:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
export USE_CCACHE=1
export CCACHE_EXEC=/usr/bin/ccache
ccache -M 50G

Put the exports in the build user’s ~/.bashrc only if every shell on that account should use the cache; otherwise place them in a project-specific script. The documented sizing rule is roughly 25–50 GB for one device and 75–100 GB for several devices with distinct kernels. Cache contents persist on disk, so include the limit in capacity planning and monitor free space. Compression can reduce storage use, but may trade disk savings for CPU time.

Control parallelism instead of blindly increasing jobs

Parallel jobs are limited by the smallest of CPU capacity, RAM and storage throughput. repo sync -j8 controls checkout concurrency; the build system’s compiler parallelism is separate. On a small VPS, aggressive concurrency can exhaust RAM, trigger swap and make the build slower or fail. Start with a conservative job count, watch memory and I/O, then raise it incrementally.

  • Monitor free disk before repo sync, before invoking brunch, and during long builds.
  • Watch RAM and swap; sustained swap activity means reduce parallelism or move to a larger instance.
  • Keep source and out/ on fast persistent storage rather than a nearly full boot volume.
  • Do not run unrelated services, database workloads or desktop environments on the build VPS.
  • Record the VPS shape, Ubuntu image, manifest revision, branch, codename, JDK/Python versions and job settings with each build.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot the failures that matter most

Disk exhaustion during checkout or compilation

Symptoms: No space left on device, interrupted Git transfers, incomplete generated files or a build that fails near the end. Cause: source checkout, out/, ccache and temporary extraction files compete for one volume. Fix: stop the build, remove only disposable caches or stale output after verifying what you need, expand the persistent volume, and restart with a larger free-space margin. Do not assume deleting ccache alone will recover enough room for another full device build.

Best Value
Tracfone Moto g Play 2024 Prepaid Phone with a 1-Yr Plan Included | Prepaid Smartphone with Full YR Plan Included bundled with 1500 Min/Text/Data for365 days of service - Locked to Tracfone
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
  • ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
  • CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
  • PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
  • 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US

Wrong branch or codename

Symptoms: breakfast cannot find a product, repositories are missing, or a target is not recognized. Cause: the phone codename is unsupported on that branch, or a similarly named device was selected. Fix: return to the device’s official build page, copy the branch and codename exactly, reinitialize if necessary, and run repo sync again. A device supported on one LineageOS release is not automatically supported on another.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

JDK or Python mismatch

Symptoms: Gradle, Soong or helper scripts reject the installed runtime. Cause: the branch expects a different Java or Python version than the Ubuntu image provides. Fix: install the version documented for that branch, ensure the build shell resolves it first in PATH, and verify the version commands before restarting. Avoid mixing packages from unrelated Android releases.

Missing proprietary blobs

Symptoms: extraction scripts report absent files, a build stops while resolving vendor modules, or the image builds but hardware does not function. Cause: the device tree references files that are not in public repositories, or blobs came from an incompatible firmware release. Fix: follow the device page’s extraction instructions and use the specified source build. Re-running repo sync cannot download files that the project intentionally does not publish.

VPS disconnect or provider interruption

Symptoms: an SSH session disappears and the build stops, or a reboot loses uncommitted work. Fix: run synchronization and builds inside tmux or screen, keep the manifest revision and local patches in version control, and copy logs and release artifacts to separate persistent storage. A terminal multiplexer protects the process from a network disconnect but cannot protect against deletion of an ephemeral disk.

Over-parallelization and swapping

Symptoms: load average is high, memory is exhausted, the kernel kills compiler processes, or a nominally larger job count takes longer. Fix: lower checkout and build concurrency, stop unrelated services, and move to a VPS with more RAM if the workload still swaps. More threads are useful only when the machine can feed them.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make builds reproducible and recoverable

  1. Write down the ROM branch, manifest revision, device codename, vendor-blob source, Ubuntu release and Java/Python versions.
  2. Keep local patches and device-tree changes in Git rather than editing generated files.
  3. Save the exact command line, environment exports and build log for each release candidate.
  4. Use persistent volumes and snapshots only as a supplement to an off-server backup; a snapshot taken during a write-heavy build may not be a clean source state.
  5. Separate source, output, cache and final artifacts when the provider allows multiple volumes, while preserving enough free space on each.
  6. Before distributing an image, verify that it corresponds to the intended device codename and branch and that the device page’s installation requirements are met.

End-to-end checklist

  • Decide whether the goal is generic AOSP or a flashable image for a named device.
  • Identify the exact codename, supported ROM branch and required proprietary-file procedure.
  • Provision 64-bit x86 Ubuntu with at least 64 GB RAM and 400 GB free persistent disk for current AOSP-scale work; add headroom for ccache and multiple devices.
  • Install the versioned AOSP packages and the device guide’s additional LineageOS utilities.
  • Use an unprivileged build account, SSH keys and a persistent tmux or screen session.
  • Initialize and sync the correct manifest, then record the revision.
  • Load build/envsetup.sh; for LineageOS run breakfast <device-codename> and then brunch <device-codename>.
  • Configure ccache only after reserving its disk allowance and tune concurrency to observed RAM and I/O.
  • Back up manifests, patches, logs and completed artifacts outside the VPS.

An Ubuntu VPS is therefore a practical Android build host when it is treated like a dedicated build workstation: current memory and storage minimums, a pinned branch, exact device integration files and persistent remote-session hygiene matter more than the VPS label itself. Generic AOSP is the straightforward platform path; a flashable device ROM succeeds only when the branch, codename, kernel, device tree, vendor blobs and toolchain all agree.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.