# Self-host Sonic

> Fast, lightweight schema less search index server that stores identifiers instead of documents. The install form carries config.cfg as an editable file and a generated channel password.

- Page: https://levelrail.com/templates/sonic/
- JSON: https://levelrail.com/templates/sonic.json
- Category: Database Tools
- Licence: MPL-2.0 (Copyleft license)
- Source: https://github.com/valeriansaliou/sonic
- Upstream docs: https://github.com/valeriansaliou/sonic#how-to-use-it

## Requirements
- Memory: about 128 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: v1.10.2

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| sonic | valeriansaliou/sonic | v1.10.2 | 1491 | store -> /var/lib/sonic/store |

## Deploy

### CLI

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

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain sonic=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/sonic/install \
  -d '{
    "name": "my-sonic"
  }'
```

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

## First run
1. Connect a Sonic client library to port 1491 with the generated channel password shown in the deployment variables.

## Questions

### Can I deploy Sonic 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 Sonic, 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 valeriansaliou/sonic:v1.10.2 is what you deploy there.

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