<!doctype html><htmllang=en-us><head><metacharset=utf-8><metahttp-equiv=x-ua-compatiblecontent="ie=edge"><metaname=viewportcontent="width=device-width,initial-scale=1,shrink-to-fit=no"><linkrel=preloadas=fonthref=/fonts/vendor/jost/jost-v4-latin-regular.woff2type=font/woff2crossorigin><linkrel=preloadas=fonthref=/fonts/vendor/jost/jost-v4-latin-700.woff2type=font/woff2crossorigin><linkrel=stylesheethref=/main.f998e900ad1763639b2de999d219c60a588fb531888a0672d99b77aca3c151f84bdf80fcc8ca4046d0c23b9d5873eb2d32c59c17011fead4bedea7bc2b062d61.cssintegrity="sha512-+ZjpAK0XY2ObLemZ0hnGCliPtTGIigZy2Zt3rKPBUfhL34D8yMpARtDCO51Yc+stMsWcFwEf6tS+3qe8KwYtYQ=="crossorigin=anonymous><noscript><style>img.lazyload{display:none}</style></noscript><metaname=robotscontent="index, follow"><metaname=googlebotcontent="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"><metaname=bingbotcontent="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"><title>Deploy bare metal - mCaptcha</title><metaname=descriptioncontent="Bare metal deployment is tedious, most of this will be automated with a script in the future."><linkrel=canonicalhref=/docs/self-hosting/bare-metal/><metaname=twitter:cardcontent="summary_large_image"><metaname=twitter:imagecontent="/icon.png"><metaname=twitter:titlecontent="Deploy bare metal"><metaname=twitter:descriptioncontent="Bare metal deployment is tedious, most of this will be automated with a script in the future."><metaname=twitter:sitecontent="@"><metaname=twitter:creatorcontent="@"><metaproperty="og:title"content="Deploy bare metal"><metaproperty="og:description"content="Bare metal deployment is tedious, most of this will be automated with a script in the future."><metaproperty="og:type"content="article"><metaproperty="og:url"content="/docs/self-hosting/bare-metal/"><metaproperty="og:image"content="/icon.png"><metaproperty="article:modified_time"content="2024-01-08T00:31:40+05:30"><metaproperty="og:site_name"content="mCaptcha"><metaproperty="article:publisher"content="https://www.facebook.com/"><metaproperty="article:author"content="https://www.facebook.com/"><metaproperty="og:locale"content="en_US"><scripttype=application/ld+json>{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"\/"},{"@type":"ListItem","position":2,"name":"Docsself Hostingbare Metal","item":"\/docsself-hostingbare-metal\/"}]}</script><metaname=theme-colorcontent="#fff"><linkrel=apple-touch-iconsizes=180x180href=/apple-touch-icon.png><linkrel=icontype=image/pngsizes=32x32href=/favicon-32x32.png><linkrel=icontype=image/pngsizes=16x16href=/favicon-16x16.png><linkrel=manifesthref=/site.webmanifest></head><bodyclass="docs single"><divclass="header-bar fixed-top"></div><headerclass="navbar fixed-top navbar-expand-md navbar-light"><divclass=container><inputclass="menu-btn order-0"type=checkboxid=menu-btn>
choice of database is described using the <ahref=https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#scheme>scheme</a> of the database URL. For
instance:</p><ol><li>Postgres: <code>postgres://mcaptcha:password@localhost:5432/mcaptcha</code></li><li>Mariadb: <code>mysql://mcaptcha:password@localhost:3306/mcaptcha</code></li></ol><h2id=2-optionally-install-mcaptchacache>2. Optionally, install mCaptcha/cache<ahref=#2-optionally-install-mcaptchacacheclass=anchoraria-hidden=true>#</a></h2><p>We recommend this for larger instances. For single-user instances or for
<ahref=https://github.com/mCaptcha/mCaptcha/blob/d4967626ee59504b32b0f85e409b4e3444ddc4f0/config/default.toml#L54><code>redis</code></a> section of the configuration file.</p><p>Please see <ahref=https://github.com/mCaptcha/cache><code>mCaptcha/cache</code></a> for more details.</p><h2id=3-install-mcaptcha>3. Install mCaptcha<ahref=#3-install-mcaptchaclass=anchoraria-hidden=true>#</a></h2><h3id=31-install-from-source>3.1 Install from source<ahref=#31-install-from-sourceclass=anchoraria-hidden=true>#</a></h3><p>To build <code>mcaptcha</code>, you need the following dependencies:</p><ol><li>rust</li><li>node(<code>v20</code>)</li><li>yarn(JavaScript package manager)</li><li>make</li></ol><p>With all dependencies installed, run:</p><pre><code>make dev-env && make release
</code></pre><p>And the following commands to install the compiled binary:</p><pre><code>sudo cp ./target/release/mcaptcha /usr/bin/ && \
</code></pre><h3id=iii-verify-gpg-signature>iii Verify GPG signature<ahref=#iii-verify-gpg-signatureclass=anchoraria-hidden=true>#</a></h3><p>All mcaptcha binaries are signed with <ahref="https://keyserver.ubuntu.com/pks/lookup?search=73DAC973A9ADBB9ADCB5CDC4595A08135BA9FF73&fingerprint=on&op=index">our GPG
</code></pre><h3id=4-configuration>4. Configuration<ahref=#4-configurationclass=anchoraria-hidden=true>#</a></h3><p>mCaptcha is highly configurable.</p><p>Configuration is applied/merged in the following order:</p><ol><li>path to configuration file passed in via <code>MCAPTCHA_CONFIG</code></li><li><code>./config/default.toml</code></li><li><code>/etc/mcaptcha/config.toml</code></li><li>environment variables. Please see
<ahref=https://github.com/mCaptcha/mCaptcha/blob/master/docs/CONFIGURATION.md>here</a> for a full list of environment variables.</li></ol><h3id=5-systemd-service-configuration>5. Systemd service configuration:<ahref=#5-systemd-service-configurationclass=anchoraria-hidden=true>#</a></h3><ol><li>Copy the following to <code>/etc/systemd/system/mcaptcha.service</code>:</li></ol><pre><code>[Unit]
</code></pre><h3id=6-install-and-configure-nginx>6. Install and configure Nginx<ahref=#6-install-and-configure-nginxclass=anchoraria-hidden=true>#</a></h3><p>mCaptcha doesn’t implement SSL yet. Please use a reverse proxy like