Self-host Windmill
Getting started
Windmill GitHub repository contains all the necessary files to run Windmill locally, or to self-host it.
We encourage docker-based deployments, and provide a docker-compose file to help you get started.
Docker
Simplified instruction for docker-compose in the README.
When talking about the 'compose', or 'caddyfile', we explicitly refer to the ones on Windmill's GitHub repository.
Using docker and caddy, Windmill can be deployed using two files,
(docker-compose.yml
and
Caddyfile
) and in a single command.
Caddy takes care of managing the
TLS certificate and the reverse proxy, Postgres of storage, Windmill-LSP
provides editor intellisense. All managed by one
docker-compose.yml
file.
Configuration
Let's assume you wish to deploy Windmill to the windmill.example.com
domain.
This information only needs to be propagated to the docker-compose.yml
file,
using the WM_BASE_URL
environment variable.
Create/edit the .env
file at the root of the project and set your desired address:
# .env
DB_PASSWORD=supersecret
WM_BASE_URL=windmill.example.com
Setting the WM_BASE_URL
configures Windmill to use it as its base url,
but also configures Caddy to use it as the domain.
Deployment
Once you have setup your environment for deployment, you can run the following command:
$ docker compose up
That's it! Head over to your domain and you should be greeted with the login screen.
Default credentials are [email protected]
and changeme
Update
To update to newer version of Windmill, all you have to do is run:
docker compose pull
or docker compose pull windmill
if you wish to update
only the Windmill image.
Database volume is persistent, so updating the database image is safe too.
Helm chart
We also provide a convenient helm chart for Kubernetes based self-hosted setup.
Detailed instructions can be found in the README file in the official repository of the chart.
If you're familiar with helm and want to get started quickly, you can deploy quickly with the snippet below. detailed instructions in the official repository:
# add the Windmill helm repo
helm repo add windmill https://windmill-labs.github.io/windmill-helm-charts/
# install chart with default values
helm install windmill-chart windmill/windmill \
--namespace=windmill \
--create-namespace
Enterprise deployment with Helm
The Enterprise edition of Windmill uses different base images and supports additional features. One important feature is better caching for depencies in a super cache supported by S3.
You need:
- An Enterprise license key
- An AWS account and S3 bucket
- AWS credentials or IAM roles prepared for access from the Windmill worker pods
See the helm chart repo readme for more details. The exact setup for S3 access will vary according to your environment.
Compile from source
- Go to
frontend/
:npm run install
,npm run generate-backend-client
thennpm run build
- Install the lld linker
- Go to
backend/
:SQLX_OFFLINE=true cargo build --release
- The windmill binary is at:
target/release/windmill
It is enough to run it with DATABASE_URL=<your_database_url> ./windmill
Windmill binary will make the assumption that nsjail is in PATH
, that python3 is
available at /usr/local/bin/python3
and deno at /usr/bin/deno
. it will also
assume that you are connected to postgres using a superuser. If you cannot use a
superuser, see the following section.
Run windmill without using a postgres superuser
Create the database with your non-super as owner:
CREATE DATABASE windmill OWNER nonsuperuser
As a superuser, create the windmill_user and windmill_admin roles with the proper privileges, using:
psql <DATABASE_URL> -f init-db-as-superuser.sql
where init-db-as-superuser.sql
is this
file
It will not give windmill users access to all your databases, just that one because the schema public is not shared across database, it is contained wholly inside each database: https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PUBLIC
Then last, run the following commands
GRANT windmill_admin TO nonsuperuser;
GRANT windmill_user TO nonsuperuser;