• Documentation
  • Repositories
  • Workspace limitations


sudo access

Typically, sudo access allows users to run programs with the privileges of another user (the superuser) by default. Currently, due to security reasons, CodeSandbox Repositories don't provide an option to run sudo commands. This is necessary to provide you with collaboration features on top of the ephemeral developer environment experience.


To work around this, there are two ways to install packages.


CodeSandbox natively supports the Nix package manager. To install a package, you can define a file in the root of your project called csb.nix and configure which packages should be automatically installed from the nix package store.

See an example configuration below:

with import <nixpkgs> {};
stdenv.mkDerivation {
    name = "csb";
    buildInputs = [
    shellHook = ''
        export PATH="$PWD/node_modules/.bin/:$PATH"

This automatically installs Postgres and htop the next time you open a terminal. An example of a project running Nix can be found here.


We also support running Docker. You can run docker directly from the terminal, and within the Docker containers to which you do have root access.