When you begin a new capsule, you will first choose a base environment, and then (probably) use the built-in package management system to install common libraries. In general, if you can use the package managers to install libraries, you should, because they take care of some capsule optimization features, such as removing unused files, without user intervention.

Sometimes, however, you will need software that isn't currently available through a package manager, or which needs a precisely specified order of operations. For these use cases, use the postInstall script. Here, you can  run any commands that you could run on a Linux system (e.g., curl , unzip /tar , or git clone ). It will be available beneath the package managers in the 'Environment' screen:

Because the script will be run as part of the build phase, any commands will be run once, and will then be cached as part of your capsule's custom environment. See Monitoring and inspecting the result of the environment setup phase for more information.

Note that many software installation instructions will specify commands such as sudo apt-get install python-dev; sudo  is unnecessary on Code Ocean. (You are root user by default.)

Example use cases:

For scripts that install new or additional languages, see Setting up new or additional languages on Code Ocean

For MATLAB specifically, see Installing user-provided MATLAB toolboxes.

Did this answer your question?