# Self-host Livebook

> Interactive and collaborative code notebooks for Elixir with a built in package manager and visualizations. A generated password protects the editor.

- Page: https://levelrail.com/templates/livebook/
- JSON: https://levelrail.com/templates/livebook.json
- Category: Developer Tools
- Licence: Apache-2.0 (Permissive license)
- Source: https://github.com/livebook-dev/livebook
- Upstream docs: https://livebook.dev/

## Requirements
- Memory: about 512 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 0.19.10

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| livebook | ghcr.io/livebook-dev/livebook | 0.19.10 | 8080 | data -> /data |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| livebook | LIVEBOOK_IP | preset |
| livebook | LIVEBOOK_PASSWORD | generated |

## Deploy

### CLI

```bash
levelrail-cli templates install livebook --name my-livebook
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain livebook=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/livebook/install \
  -d '{
    "name": "my-livebook"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## First run
1. Sign in with the generated password shown in the deployment variables. Notebooks run code in this container, so keep the address private.

## Questions

### Can I deploy Livebook on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Livebook, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image ghcr.io/livebook-dev/livebook:0.19.10 is what you deploy there.

Self-host Livebook, Livebook docker compose file, deploy Livebook on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
