<!doctype html><htmllang=enclass=no-js><head><metacharset=utf-8><metaname=viewportcontent="width=device-width,initial-scale=1"><metaname=descriptioncontent="An open source, self-hosted implementation of the Tailscale control server."><metaname=authorcontent="Headscale authors"><linkhref=https://juanfont.github.io/headscale/development/setup/install/source/rel=canonical><linkhref=../container/rel=prev><linkhref=../../upgrade/rel=next><linkrel=iconhref=../../../assets/favicon.png><metaname=generatorcontent="mkdocs-1.6.1, mkdocs-material-9.5.49"><title>Build from source - Headscale</title><linkrel=stylesheethref=../../../assets/stylesheets/main.6f8fc17f.min.css><linkrel=stylesheethref=../../../assets/stylesheets/palette.06af60db.min.css><linkrel=preconnecthref=https://fonts.gstatic.comcrossorigin><linkrel=stylesheethref="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback"><style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style><script>__md_scope=newURL("../../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script><metaproperty=og:typecontent=website><metaproperty=og:titlecontent="Build from source - Headscale"><metaproperty=og:descriptioncontent="An open source, self-hosted implementation of the Tailscale control server."><metaproperty=og:imagecontent=https://juanfont.github.io/headscale/development/assets/images/social/setup/install/source.png><metaproperty=og:image:typecontent=image/png><metaproperty=og:image:widthcontent=1200><metaproperty=og:image:heightcontent=630><metacontent=https://juanfont.github.io/headscale/development/setup/install/source/property=og:url><metaname=twitter:cardcontent=summary_large_image><metaname=twitter:titlecontent="Build from source - Headscale"><metaname=twitter:descriptioncontent="An open source, self-hosted implementation of the Tailscale control server."><metaname=twitter:imagecontent=https://juanfont.github.io/headscale/development/assets/images/social/setup/install/source.png></head><bodydir=ltrdata-md-color-scheme=defaultdata-md-color-primary=whitedata-md-color-accent=indigo><inputclass=md-toggledata-md-toggle=drawertype=checkboxid=__drawerautocomplete=off><inputclass=md-toggledata-md-toggle=searchtype=checkboxid=__searchautocomplete=off><labelclass=md-overlayfor=__drawer></label><divdata-md-component=skip><ahref=#build-from-sourceclass=md-skip> Skip to content </a></div><divdata-md-component=announce></div><divdata-md-color-scheme=defaultdata-md-component=outdatedhidden></div><headerclass=md-headerdata-md-component=header><navclass="md-header__inner md-grid"aria-label=Header><ahref=../../..title=Headscaleclass="md-header__button md-logo"aria-label=Headscaledata-md-component=logo><imgsrc=../../../logo/headscale3-dots.svgalt=logo></a><labelclass="md-header__button md-icon"for=__drawer><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg></label><divclass=md-header__titledata-md-component=header-title><divclass=md-header__ellipsis><divclass=md-header__topic><spanclass=md-ellipsis> Headscale </span></div><divclass=md-header__topicdata-md-component=header-topic><spanclass=md-ellipsis> Build from source </span></div></div></div><formclass=md-header__optiondata-md-component=palette><inputclass=md-optiondata-md-color-mediadata-md-color-scheme=defaultdata-md-color-primary=whitedata-md-color-accent=indigoaria-label="Switch to dark mode"type=radioname=__paletteid=__palette_0><labelclass="md-header__button md-icon"title="Switch to dark mode"for=__palette_1hidden><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M128a44000-444400044440004-444000-4-4m0
</span><spanid=__span-0-8><aid=__codelineno-0-8name=__codelineno-0-8href=#__codelineno-0-8></a><spanclass=c1># optionally checkout a release</span>
</span><spanid=__span-0-9><aid=__codelineno-0-9name=__codelineno-0-9href=#__codelineno-0-9></a><spanclass=c1># option a. you can find official release at https://github.com/juanfont/headscale/releases/latest</span>
</span><spanid=__span-0-10><aid=__codelineno-0-10name=__codelineno-0-10href=#__codelineno-0-10></a><spanclass=c1># option b. get latest tag, this may be a beta release</span>
</span></code></pre></div><h3id=install-from-source-via-cross-compile>Install from source via cross compile<aclass=headerlinkhref=#install-from-source-via-cross-compiletitle="Permanent link">¶</a></h3><divclass="language-shell highlight"><pre><span></span><code><spanid=__span-1-1><aid=__codelineno-1-1name=__codelineno-1-1href=#__codelineno-1-1></a><spanclass=c1># Install prerequisites</span>
</span><spanid=__span-1-2><aid=__codelineno-1-2name=__codelineno-1-2href=#__codelineno-1-2></a><spanclass=c1># 1. go v1.20+: headscale newer than 0.21 needs go 1.20+ to compile</span>
</span><spanid=__span-1-3><aid=__codelineno-1-3name=__codelineno-1-3href=#__codelineno-1-3></a><spanclass=c1># 2. gmake: Makefile in the headscale repo is written in GNU make syntax</span>
</span><spanid=__span-1-9><aid=__codelineno-1-9name=__codelineno-1-9href=#__codelineno-1-9></a><spanclass=c1># optionally checkout a release</span>
</span><spanid=__span-1-10><aid=__codelineno-1-10name=__codelineno-1-10href=#__codelineno-1-10></a><spanclass=c1># option a. you can find official release at https://github.com/juanfont/headscale/releases/latest</span>
</span><spanid=__span-1-11><aid=__codelineno-1-11name=__codelineno-1-11href=#__codelineno-1-11></a><spanclass=c1># option b. get latest tag, this may be a beta release</span>
</span><spanid=__span-1-18><aid=__codelineno-1-18name=__codelineno-1-18href=#__codelineno-1-18></a><spanclass=c1># copy headscale to openbsd machine and put it in /usr/local/sbin</span>