date: “2016-12-01T16:00:00+02:00” title: “Installation from source” slug: “install-from-source” weight: 10 toc: true draft: false menu: sidebar:
parent: "installation"
name: "From source"
weight: 30
identifier: "install-from-source"
You should install go and set up your go
environment correctly. In particular, it is recommended to set the $GOPATH
environment variable and to add the go bin directory or directories
${GOPATH//://bin:}/bin
to the $PATH
. See the Go wiki entry for
GOPATH.
Note: When executing make tasks that require external tools, like
make misspell-check
, Gitea will automatically download and build these as
necessary. To be able to use these, you must have the "$GOPATH/bin"
directory
on the executable path. If you don’t add the go bin directory to the
executable path, you will have to manage this yourself.
Note 2: Go version 1.9 or higher is required. However, it is recommended to obtain the same version as our continuous integration, see the advice given in }}‘>(See here how to get Make). Various make tasks are provided to keep the build process as simple as possible.
Depending on requirements, the following build tags can be included.
bindata
: Build a single monolithic binary, with all assets included.sqlite sqlite_unlock_notify
: Enable support for a
SQLite3 database. Suggested only for tiny
installations.pam
: Enable support for PAM (Linux Pluggable Authentication Modules). Can
be used to authenticate local users or extend authentication to methods
available to PAM.Bundling assets into the binary using the bindata
build tag can make
development and testing easier, but is not ideal for a production deployment.
To include assets, they must be built separately using the generate
make
task e.g.:
TAGS="bindata" make generate build
In the default release build of our continuous integration system, the build
tags are: TAGS="bindata sqlite sqlite_unlock_notify"
. The simplest
recommended way to build from source is therefore:
TAGS="bindata sqlite sqlite_unlock_notify" make generate build
After following the steps above, a gitea
binary will be available in the working directory.
It can be tested from this directory or moved to a directory with test data. When Gitea is
launched manually from command line, it can be killed by pressing Ctrl + C
.
./gitea web