> ## Documentation Index
> Fetch the complete documentation index at: https://docs.riza.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Runtimes

> Giving your scripts access to custom packages on Riza

[Custom runtimes](/guides/custom-runtimes) work with the self-hosted Riza Code
Interpreter.

```Dockerfile theme={null}
# syntax=docker/dockerfile:1

FROM rizaio/code-interpreter:0.3.1-jammy

RUN --mount=type=secret,id=riza-api-key,env=RIZA_API_KEY \
    ["/riza", "load-custom-runtime", "<a_custom_runtime_revision_id>"]
```

You need to provide a valid API key during the build to load the custom runtime.

```sh theme={null}
docker build --secret id=riza-api-key,env=RIZA_API_KEY -t custom-interpreter .
```

After your image is built, the runtime will be automatically loaded and ready when starting the server.

```sh theme={null}
$ docker run -p3003:3003 -e RIZA_LICENSE_KEY=riza_license_yyy_xxx --rm -it custom-interpreter  
{"timestamp":"2024-10-03T23:11:29.075343Z","level":"INFO","fields":{"message":"successfully validated license key"},"target":"cli"}
{"timestamp":"2024-10-03T23:11:29.075601Z","level":"INFO","fields":{"message":"loaded module","cached":true,"language":"Python"},"target":"warden_lib"}
{"timestamp":"2024-10-03T23:11:29.155638Z","level":"INFO","fields":{"message":"loaded module","cached":true,"language":"JavaScript / TypeScript"},"target":"warden_lib"}
{"timestamp":"2024-10-03T23:11:29.184554Z","level":"INFO","fields":{"message":"loaded custom runtime","cached":true,"filename":"/root/.cache/riza-runtimes/xxx.cwasm"},"target":"cli"}
```
