---
title: How to install system packages in Vercel Sandbox
description: Learn how to install additional system packages in Vercel Sandbox with apt-get on the default Ubuntu-based managed images, or dnf on legacy Amazon Linux runtimes.
url: /kb/guide/how-to-install-system-packages-in-vercel-sandbox
canonical_url: "https://vercel.com/kb/guide/how-to-install-system-packages-in-vercel-sandbox"
published: 2026-01-29
last_updated: 2026-08-26
authors: Amy Burns
related:
  - /docs/sandbox/concepts/images
  - /docs/sandbox/sdk-reference
  - /docs/sandbox/concepts/runtimes
  - /docs/sandbox/concepts/snapshots
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

Vercel Sandbox boots from [Vercel Managed Images](https://vercel.com/docs/sandbox/concepts/images) by default. Starting with version 3 of the Sandbox SDK, new sandboxes use the Ubuntu-based `vercel/sandbox/universal:latest` image, which ships with Node.js, Python, common coding agents, and standard utilities, so most workloads never need to install packages at boot. When your use case requires something beyond the defaults, you can install it yourself with the image's package manager on the `runCommand` method.

The default managed images are Ubuntu-based, so you'll install packages using `apt-get`. Any command that modifies system packages needs root privileges, which you can enable by setting `sudo: true`.

## Install packages with TypeScript

In this example, we'll install Go using TypeScript and the [Sandbox](https://vercel.com/docs/sandbox/sdk-reference#sandbox.runcommand) `runCommand`:

```typescript
import { Sandbox } from '@vercel/sandbox';

const sandbox = await Sandbox.create();

await sandbox.runCommand({
  cmd: 'apt-get',
  args: ['install', '-y', 'golang'],
  sudo: true,
});
```

You'll pass any arguments and flags that you normally would. For example, the `-y` flag automatically confirms the installation prompt.

## Install packages with Python

And in Python:

```typescript
from vercel.sandbox import Sandbox

sandbox = Sandbox.create()

sandbox.run_command(
  'apt-get',
  ['install', '-y', 'golang'],
  sudo=True,
)
```

Set `sudo: true` because package installation requires root privileges.

## Legacy runtimes use dnf

Sandboxes created with the deprecated `runtime` property (for example `node24` or `python3.13`) run Amazon Linux 2023 instead, whose package manager is `dnf`:

```typescript
await sandbox.runCommand({
  cmd: 'dnf',
  args: ['install', '-y', 'golang'],
  sudo: true,
});
```

Check the [Amazon Linux 2023 package list](https://docs.aws.amazon.com/linux/al2023/release-notes/all-packages-AL2023.7.html) to see what's available in legacy runtimes. See the [Runtimes documentation](https://vercel.com/docs/sandbox/concepts/runtimes) for the full legacy specifications.

## Persistence

Packages you install don't persist between sessions. When a sandbox shuts down, any packages you added are lost. If you're setting up an environment you want to reuse, install your packages and then [create a snapshot](https://vercel.com/docs/sandbox/concepts/snapshots#create-a-snapshot) of the sandbox. When you create a new sandbox from that snapshot, your packages will already be there. For a fully reproducible environment, you can also extend a managed image with your own Dockerfile and boot sandboxes from that [custom image](https://vercel.com/docs/sandbox/concepts/images).

## Available packages

The default `vercel/sandbox/universal:latest` image is a rolling release on Ubuntu with Node.js, Python with `uv`, common coding agents, and utilities including `git`, `vim`, `nano`, `tmux`, `ripgrep`, `jq`, and `fzf` preinstalled. Beyond those, anything in Ubuntu's package repositories is available through `apt-get`.

Common examples include:

- **Language runtimes:** `golang`, `rust`, `ruby`
  
- **Build tools:** `make`, `cmake`, `gcc`
  
- **Utilities:** `htop`, `sqlite3`, `imagemagick`