--- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "dokploy_libsql Resource - dokploy" subcategory: "" description: |- A managed libSQL instance running on Dokploy. ~> Creating this resource provisions the service definition but does not start a deployment. Deploy it from the Dokploy UI or CLI. ~> Credentials are stored in Terraform state. Use a state backend with encryption at rest. libSQL runs as a sqld server. A primary node owns the data; a replica node follows a primary named by sqld_primary_url. --- # dokploy_libsql (Resource) A managed libSQL instance running on Dokploy. ~> Creating this resource provisions the service definition but does **not** start a deployment. Deploy it from the Dokploy UI or CLI. ~> Credentials are stored in Terraform state. Use a state backend with encryption at rest. libSQL runs as a `sqld` server. A `primary` node owns the data; a `replica` node follows a primary named by `sqld_primary_url`. ## Schema ### Required - `database_password` (String, Sensitive) Password for the database user. - `database_user` (String) Database user to create. - `docker_image` (String) libSQL server image to run, for example `ghcr.io/tursodatabase/libsql-server:latest`. - `environment_id` (String) Environment this database belongs to. - `name` (String) Display name of the database. ### Optional - `app_name` (String) Unique Docker service name. Generated from `name` when omitted, because Dokploy's libSQL endpoint does not generate one. Changing it forces a new database. - `command` (String) Override the container entrypoint command. - `cpu_limit` (String) Hard CPU limit, for example `1`. - `cpu_reservation` (String) Soft CPU reservation, for example `0.5`. - `description` (String) Free-form description. - `detach_dokploy_network` (Boolean) Detach the service from the shared `dokploy-network`. - `enable_namespaces` (Boolean) Serve multiple logical databases from one instance through libSQL namespaces. - `endpoint_spec_swarm` (String) Docker Swarm endpoint specification, as a JSON object. - `env` (String) Environment variables in `KEY=value` format, one per line. - `external_admin_port` (Number) Host port exposing the admin API. - `external_grpc_port` (Number) Host port exposing the gRPC replication endpoint. - `external_port` (Number) Host port exposing the HTTP API. - `health_check_swarm` (String) Docker Swarm health check configuration, as a JSON object. - `labels_swarm` (String) Docker Swarm service labels, as a JSON object. - `memory_limit` (String) Hard memory limit, for example `512m`. - `memory_reservation` (String) Soft memory reservation, for example `256m`. - `mode_swarm` (String) Docker Swarm service mode, as a JSON object. - `network_ids` (List of String) IDs of additional Docker networks to attach. - `network_swarm` (String) Docker Swarm network attachments, as a JSON array. - `placement_swarm` (String) Docker Swarm placement constraints, as a JSON object. - `replicas` (Number) Number of replicas to run. - `restart_policy_swarm` (String) Docker Swarm restart policy, as a JSON object. - `rollback_config_swarm` (String) Docker Swarm rollback configuration, as a JSON object. - `server_id` (String) Remote server to deploy on. Omit to use the Dokploy host itself. - `sqld_node` (String) Role this node plays in a libSQL cluster. Valid values: `primary`, `replica`. Defaults to `primary`. - `sqld_primary_url` (String) URL of the primary node, when `sqld_node` is `replica`. - `stop_grace_period_swarm` (Number) Grace period in nanoseconds before a container is killed. - `update_config_swarm` (String) Docker Swarm rolling update configuration, as a JSON object. ### Read-Only - `application_status` (String) Current status reported by Dokploy: `idle`, `running`, `done` or `error`. - `created_at` (String) RFC 3339 timestamp of when the database was created. - `id` (String) Unique libSQL identifier.