# Self-Hosted on

/docs/self-hosted/ Recent content in Self-Hosted on Hugo -- gohugo.io en-US

# Getting started

/docs/self-hosted/getting-started/ Mon, 01 Jan 0001 00:00:00 +0000/docs/self-hosted/getting-started/Get started There are two main ways to self-host mCaptcha: Bare metal With Docker

# Deploy bare metal

/docs/self-hosted/bare-metal/ Mon, 01 Jan 0001 00:00:00 +0000/docs/self-hosted/bare-metal/2. Configure mcaptcha is highly configurable. Configuration is applied/merged in the following order: path to configuration file passed in via MCAPTCHA_CONFIG ./config/default.toml /etc/mcaptcha/config.toml environment variables. 1. Install postgres if you don&rsquo;t have it already. For Debian based distributions: 1sudo apt install postgres 2. Create new user for running mcaptcha 1$ sudo useradd -b /srv -m -s /usr/bin/zsh mcaptcha 3. Create new user in Postgres 1$ sudo -iu postgres # switch to `postgres` user 2$ psql 3postgres=# CREATE USER mcaptcha WITH PASSWORD &#39;my super long password and yes you need single quote`; 4$ createdb -O mcaptcha mcaptcha # create db &#39;mcaptcha&#39; with &#39;mcaptcha&#39; as owner 4.

# Using Docker

/docs/self-hosted/docker/ Mon, 01 Jan 0001 00:00:00 +0000/docs/self-hosted/docker/With Docker 1. Configure mcaptcha is highly configurable. Configuration is applied/merged in the following order: path to configuration file passed in via MCAPTCHA_CONFIG ./config/default.toml /etc/mcaptcha/config.toml environment variables. See CONFIGURATION.md for configurable options. 2. Run image If you have already have a Postgres instance running, then: 1docker run -p &lt;host-machine-port&gt;:&lt;port-in-configuration-file&gt; \ 2 --add-host=database:&lt;database-ip-addrss&gt; \ 3 -e RUST_LOG=debug \ 4 -e DATABASE_URL=&#34;postgres://&lt;db-user&gt;:&lt;db-password&gt;@database:&lt;db-port&gt;/&lt;db-name&gt;&#34; \ 5 mcaptcha/mcaptcha:latest If you don&rsquo;t have a Postgres instance running, you can either install one using a package manager or launch one with docker.

# Database and cache

/docs/self-hosted/dependencies/ Mon, 01 Jan 0001 00:00:00 +0000/docs/self-hosted/dependencies/Notes Database Database migrations are baked into the server binary so don&rsquo;t worry about them. When compiling from source, unset database configuration(comment out database configuration/ unset relevant environment variables). mCaptcha uses sqlx database client library which checks SQL queries at compile time. So if you are starting with a fresh database without migrations applied, compilation will fail. Redis Redis is an optional dependency.