# Try it locally

This page gets Lalabase running on your own computer, without a domain, a certificate or a
mail server. It suits a trial. For a server, use [Docker Compose](https://lalabase.com/docs/en/self-hosting/installation/docker-compose) instead; to
work on the code, use
[`DEVELOPMENT.md`](https://github.com/lalabase/lalabase/blob/main/DEVELOPMENT.md).

You need [Docker Desktop](https://www.docker.com/products/docker-desktop/) (Docker 24 or later
with Compose v2) and about 4 GB of memory for it. Apple Silicon and Intel both work.

## Install

Get the latest release and write a `.env` with fresh keys. Copy all of it at once:

```bash
git clone https://github.com/lalabase/lalabase.git
cd lalabase
git checkout "$(git tag --list '[0-9][0-9][0-9][0-9].[0-9]*.[0-9]*' --sort=-v:refname | head -1)"

cat > .env <<EOF
LALABASE_HOST=localhost:3000
LALABASE_PORT=3000
LALABASE_FORCE_SSL=false
SECRET_KEY_BASE=$(openssl rand -hex 64)
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=$(openssl rand -hex 32)
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=$(openssl rand -hex 32)
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=$(openssl rand -hex 32)
POSTGRES_PASSWORD=$(openssl rand -hex 24)
EOF

docker compose up -d
```

Is port 3000 taken already, say by another Rails application? Then change **both** lines, for
example to `LALABASE_HOST=localhost:3100` and `LALABASE_PORT=3100`. Lalabase only answers to
the address in `LALABASE_HOST`.

Wait until `docker compose ps` shows `web` as `healthy`.

<div class="docs-callout docs-callout--danger">
  <div class="docs-callout__title">For a trial only</div>
  <p><code>LALABASE_FORCE_SSL=false</code> turns off the redirect to HTTPS and secure cookies. It has no place on a server reachable from the internet.</p>
</div>

## Create the admin and your first user

Create the instance admin. The command asks for an email address and a password of at least
12 characters:

```bash
docker compose exec web bin/rails lalabase:setup
```

Then create your user without any mail:

1. Sign in at <http://localhost:3000/admin>.
2. Open <http://localhost:3000/admin/users/new>, enter a name and an email address and name a
   new organisation.
3. Note the **temporary password** in the message at the top of the next page. It appears only
   this once.
4. Sign in with it at <http://localhost:3000/users/sign_in> and change the password.

The command itself points you to the registration at `/users/sign_up`. Skip that here: without
mail the confirmation never arrives, and the account is locked after three days.

## Stop and remove

```bash
docker compose stop        # stop; your data stays
docker compose start       # start again
docker compose down -v     # remove everything, including all data
```

## Next steps

- [Create your first project](https://lalabase.com/docs/en/guides/basics/first-project).
- Connect the [CLI tool](https://lalabase.com/docs/en/cli/getting-started/overview) with
  `url = "http://localhost:3000"`, or an agent over [MCP](https://lalabase.com/docs/en/mcp/introduction/overview).
- Turn on the AI with your own [key](https://lalabase.com/docs/en/self-hosting/configuration/ai-byok).
