Installing APIGit Enterprise Server
This guide installs APIGit Enterprise Server on one machine with Docker Compose. It takes about fifteen minutes.
What you need
- A Linux server with Docker Engine 24 or later and the Compose plugin. 2 CPU cores, 4 GB of memory and 20 GB of disk are enough to evaluate; plan for 4 cores and 8 GB for a team of a hundred.
- Host names that resolve to the server, and a reverse proxy or load balancer in front of it that holds their TLS
certificates:
- one for the application, for example
apigit.example.com - one for published documents, for example
docs.example.com - a wildcard for mock servers, for example
*.mock.example.com(each mock server answers on its own name under it)
- one for the application, for example
- The images of your release and your licence file. Both come from APIGit. The images come either as an archive (see “From the image archive” below) or as six image names with access to pull them.
- Optional: an SMTP server (invitations and password reset), an identity provider for single sign-on.
No outbound connection to APIGit is needed, at installation or afterwards.
From the image archive
If you received apigit-enterprise-<release>.tar.gz, no registry is needed, and the server needs no way out to the
internet:
sha256sum -c apigit-enterprise-<release>.tar.gz.sha256
tar xzf apigit-enterprise-<release>.tar.gz
cd apigit-enterprise-<release>
sha256sum -c SHA256SUMS
docker load -i images.tar
cd packageThe six image names are already set in .env.example there. Continue with step 1 for the addresses and secrets.
1. Configure
cp .env.example .envFill in .env:
| Setting | Value |
|---|---|
APIGIT_BACKEND_IMAGE, APIGIT_WEB_IMAGE, APIGIT_VIEWER_IMAGE, APIGIT_TRYIT_IMAGE, APIGIT_MOCK_IMAGE, APIGIT_MOCK_WORKER_IMAGE | The image names of your release (already set when you installed from the image archive) |
APIGIT_APP_URL | The address of the application, for example https://apigit.example.com |
APIGIT_DOCS_URL | The address of the document viewer, for example https://docs.example.com |
APIGIT_MOCK_HOST | The host name mock servers answer under, for example mock.example.com |
APIGIT_SECRET_KEY | openssl rand -hex 32 |
APIGIT_DB_PASSWORD | openssl rand -hex 24 |
APIGIT_INTERNAL_API_TOKEN | openssl rand -hex 32 |
Keep .env private (chmod 600 .env) and back it up: the secret key cannot be changed later.
Configure describes every other setting.
2. Start
docker compose up -d
docker compose psEight services (backend, web, viewer, tryit, mock, mock-worker, postgres, redis) should be running,
and backend healthy, within a minute or two; mock-store-init runs once and exits. The first start creates the
database.
3. Point your proxy at it
| Host name | Forward to | Note |
|---|---|---|
The application (APIGIT_APP_URL) | 127.0.0.1:8080 | Allow large request bodies (git pushes) and do not buffer them |
Documents (APIGIT_DOCS_URL), and every host name you give a published document | 127.0.0.1:8081 | Pass the Host header on unchanged: it selects the document |
Mock servers (*.<APIGIT_MOCK_HOST>) | 127.0.0.1:8082 | Pass the Host header on unchanged: it selects the mock server |
The proxy should send X-Forwarded-For and X-Forwarded-Proto. The three ports are bound to 127.0.0.1; change
APIGIT_WEB_BIND, APIGIT_VIEWER_BIND and APIGIT_MOCK_BIND if the proxy runs on another machine.
4. Create the first administrator
docker compose exec -u git backend gitea admin user create --admin \
--username admin --email admin@example.com --password '<a long password>' --must-change-password=falseOpen the application address and sign in.
5. Install the licence
Open the account menu, choose Licence, paste the contents of your licence file and save. The page then shows your company, the number of seats and the expiry date. The licence explains seats, expiry and renewal.
Without a licence the server runs with the limits of the Free plan.
6. Add users
Sign-up is closed by default. Add users on the Admin page, or connect your identity provider there (OpenID Connect or LDAP). Each user who can sign in holds one seat.
Checking the installation
docker compose ps
docker compose logs --tail 50 backend
curl -s http://127.0.0.1:8080/api/v1/versiondocker compose ps shows every service as healthy (the backend’s own check covers its database), and the last
command answers with the release’s version, for example {"version":"28.3.0+..."}, when the application port
reaches the backend.
Next
- Configure: mail, sign-up, your own PostgreSQL or Redis, published documents on their own host names, mock servers and Try it
- Security: what mock scripts and Try it can reach, and how to narrow it
- Backup and restore: what to back up and how to restore
- Upgrade: moving to a newer release
- What is not included: what this version leaves out