Code Ocean offers many base environments with different languages pre-installed. You can also use the environment & configuration options to install multiple languages in one compute capsule. Available package managers will suffice for many common languages; less common languages will likely require a postInstall script.

Which environment should I start with?

If you:

  • are not using a pre-installed language, use a base Ubuntu (18.04 or 16.04) environment;
  • need proprietary software, such as MATLAB or Stata, start from an environment with proprietary language;
  • use a GPU, select an environment with GPU access (these will be explicitly labeled as such, or will reference CUDA or a deep learning framework);
  • need general flexibility, start from an image with Conda these will have Python as well).

Installing a language using package managers:

The following are all available as apt-get packages:

  • build-essential for the C/C++ toolchain (gcc/g++, make, etc.);
  • r-base for R (r-base-dev will help you install R packages);
  • python for Python (add python-pip for pip installer support);
  • perl for Perl (add cpanm if needed);
  • luajit for Lua (add luarocks if needed);
  • default-jdk for Java;
  • gfortran for Fortran. 

Once you add R or python, the commands Rscript or python will become available, respectively.

 Installing langauges through Conda

If your base image has a conda installer, or if you add it via postInstall script, you can add languages and language-specific packages via supplemental conda channels.

  • python is available by default;
  •  julia and lua are available through conda-forge;
  •  r is available from channel r.

Installing languages using the postInstall script:

Less common languages will likely require specialized postInstall script to install. For example:

Mono is an open source implementation of Microsoft's .NET Framework. The Mono project website has instructions for installing Mono on Ubuntu 16.04

Start by choosing the "Other" language, which will get you a minimal Ubuntu environment. You can then write a postInstall script using the commands from Mono's instructions as is, with one small change: sudo is not required (nor available by default) on Code Ocean. The resulting postInstall script, with sudo taken out, looks like this:

apt-key adv --keyserver hkp:// --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb xenial main" | tee /etc/apt/sources.list.d/mono-official.list
apt-get update -qq && apt-get install -y mono-devel

As a side note, in order to build your project and run it, use the following commands in a shell script:

xbuild /p:Configuration=Release myproject.csproj
mono bin/Release/myproject.exe

Run the following postInstall script:

buildDeps="ca-certificates gcc gnat make zlib1g-dev"
apt-get update && apt-get install -y $buildDeps
release="20181129" # or whichever release is appropriate
curl -L$release.tar.gz | tar xz
cd ghdl-$release
./configure --prefix=/usr/local
make && make install
apt-get purge -y --autoremove $buildDeps && rm -rf /var/lib/apt/lists/*

Run the following postInstall script:

apt-get update && apt-get install -y lsb-release
for deb in deb deb-src; do echo "$deb `lsb_release -cs` nightly"; done | tee /etc/apt/sources.list.d/openmodelica.list
curl -s | apt-key add -
apt-key fingerprint
apt update -qq && apt install -y openmodelica
apt-get purge -y --autoremove lsb-release && rm -rf /var/lib/apt/lists/*

What if I need proprietary software that isn't currently supported?

Contact us at and we will be happy to look into it.

Did this answer your question?