Self-host Apache Answer on a managed VPS: your own Q&A platform

To self-host Apache Answer on a managed VPS is to keep the questions, answers and knowledge of your community or your team on a server of your own, which our teams keep up to date and monitor day and night. Apache Answer is a free, open source Q&A platform under the Apache-2.0 license, a project of the Apache Software Foundation. This guide follows its official Docker image at version 2.0.3, and we ran every command on a Simafri VPS before writing it: installation with Docker Compose and MySQL, the installer, HTTPS, backups, restores and upgrades.

Simon Vasconcelos Lee By Published on 26 November 202611 minute read

All guides

In short

  1. The Apache-2.0 license lets you run Apache Answer for your community, your company or your clients with no license to buy, and modify it freely.
  2. Install it with Docker Compose: the official image apache/answer and MySQL 8.4, which the project recommends over SQLite for real use, with the port published on 127.0.0.1 behind an HTTPS reverse proxy.
  3. Complete the installer before the site is public: from the terminal with three requests, or in your browser through an SSH tunnel. It writes the configuration, creates the tables and the administrator.
  4. Configure SMTP under Admin, Settings, SMTP: Apache Answer sends registration confirmations and password resets through it.
  5. Back up with mysqldump and an archive of the /data volume. To update, change the image tag: the image migrates the database itself at startup.

What Apache Answer does

Apache Answer is a question and answer platform, in the spirit of the best known developer Q&A sites: members ask, others answer, votes bring the best answers up and the author accepts the one that solved the problem. Teams use it as a community forum, a help center or an internal knowledge base. It is written in Go with a React interface, and it graduated from the Apache Incubator to become a top-level project of the Apache Software Foundation.

What the Apache-2.0 license allows

Apache Answer is published under the Apache License, version 2.0. You can use it free of charge, for your community, your company or your clients, copy it, modify it and distribute it, modified or not, as long as you keep the license and copyright notices and state the changes you made to its files. The license also grants a patent license from its contributors. The software is provided without warranty.

There is no paid edition: every feature, plugins included, is in the open source code. “Apache Answer” is a trademark of the Apache Software Foundation, which publishes rules for naming a product or a service that runs it.

The resources to plan for

The documentation sets no minimum size. Here is what we measured on our test VPS, freshly installed with one question:

Server size therefore depends on the size of your community and on the other applications you run beside it. On a managed VPS, tell us about your usage and we will recommend the right size.

Installing with Docker Compose

Apache Answer ships as a single image, apache/answer, which serves the interface and the API on port 80 of the container, and keeps its configuration, uploads and language files in /data. It supports SQLite, MySQL and PostgreSQL; the project recommends SQLite only to try it out, and MySQL for real use, which is what we tested. On a server with Docker Engine and its Compose plugin, installed from Docker’s repository for Ubuntu, create a folder such as /opt/apache-answer and put this compose.yaml in it:

compose.yaml
services:
  answer:
    image: apache/answer:2.0.3
    restart: unless-stopped
    environment:
      - TZ=Etc/UTC
    ports:
      - "127.0.0.1:8105:80"
    volumes:
      - answer_data:/data
    depends_on:
      db:
        condition: service_healthy

  db:
    image: mysql:8.4
    restart: unless-stopped
    environment:
      - MYSQL_DATABASE=answer
      - MYSQL_USER=answer
      - MYSQL_PASSWORD=${MYSQL_PASSWORD:?set MYSQL_PASSWORD in .env}
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:?set MYSQL_ROOT_PASSWORD in .env}
    volumes:
      - mysql_data:/var/lib/mysql
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
      start_period: 60s
      interval: 5s
      timeout: 5s
      retries: 10

volumes:
  answer_data:
  mysql_data:

The two database passwords go in a .env file next to it, which Docker Compose reads on its own. Create it readable by root only, then start the stack:

Terminal, in /opt/apache-answer
umask 077
printf 'MYSQL_PASSWORD=%s\nMYSQL_ROOT_PASSWORD=%s\n' "$(openssl rand -hex 24)" "$(openssl rand -hex 24)" > .env
umask 022
docker compose up -d
docker compose ps

On first start, Apache Answer finds no configuration file and serves its installer. Wait until it answers:

Terminal, in /opt/apache-answer
until curl -sf http://127.0.0.1:8105/healthz >/dev/null; do sleep 3; done
docker compose logs answer | grep "installation service"

The installer: database, site and administrator

The installer is the web page documented as the install steps: the language, the database connection, the configuration file, then the site and the administrator. Whoever completes it first becomes the administrator, which is why the port stays on 127.0.0.1 until it is done. The page itself sends three requests, and you can send them from the terminal on the server. Replace the site name, the address and the two email addresses with yours: the administrator signs in with the email, and the site address is the public one, with https://, even before HTTPS is set up. The password is generated into admin-password.txt, between 8 and 32 characters as required:

Terminal, in /opt/apache-answer
umask 077; openssl rand -hex 12 > admin-password.txt; umask 022
DB='{"db_type":"mysql","db_username":"answer","db_password":"'$(grep ^MYSQL_PASSWORD= .env | cut -d= -f2)'","db_host":"db:3306","db_name":"answer"}'
curl -s -H "Content-Type: application/json" -d "$DB" http://127.0.0.1:8105/installation/db/check; echo
curl -s -H "Content-Type: application/json" -d "$DB" http://127.0.0.1:8105/installation/init; echo
curl -s -H "Content-Type: application/json" -d '{"lang":"en_US","site_name":"My Answer","site_url":"https://answer.example.com","contact_email":"admin@example.com","name":"admin","password":"'$(cat admin-password.txt)'","email":"admin@example.com","login_required":false,"external_content_display":"ask_before_display"}' http://127.0.0.1:8105/installation/base-info; echo
until curl -s http://127.0.0.1:8105/answer/api/v1/siteinfo | grep -q "\"code\":200"; do sleep 3; done

In a browser instead, open an SSH tunnel from your computer to port 8105 of the server, then go to http://localhost:8105/install: the page asks for the same fields, in the same order. The project also documents an unattended installation, AUTO_INSTALL=true with the same values in environment variables, mainly for the binary.

HTTPS: the reverse proxy

The container serves Apache Answer over HTTP, on port 8105 of the server. HTTPS is handled by a reverse proxy in front of it. We tested Caddy, installed from its official Debian and Ubuntu repository: it obtains the Let’s Encrypt certificate itself, renews it, and forwards the Host header and X-Forwarded-* headers by default.

/etc/caddy/Caddyfile
answer.example.com {
	reverse_proxy 127.0.0.1:8105
}
Terminal, as root
systemctl reload caddy
curl -sI https://answer.example.com/

Sign in with the administrator’s email and password. On our test VPS, we published a question with an image from the API: its page came back with the question as its title, and the image was served from /uploads.

Members, email and plugins

Apache Answer sends the confirmation of new accounts, password resets and notifications by email. Under Admin, Settings, SMTP, enter the host of your SMTP relay, its port and encryption, and the username and password of the sending account, then check it with a test message. On a Simafri VPS, applications send through an authenticated SMTP relay on port 587, which also gives your email the best deliverability.

Backups

Everything lives in three places: the MySQL database, the answer_data volume with conf/config.yaml and your uploads, and your .env file. The dump holds every account and its email address, and config.yaml holds the database password, so create the copies readable by root only, with umask 077 inside parentheses: the rest of your session keeps its usual mask. A file that already exists keeps its permissions when it is overwritten, so the last line also closes the copies already in the folder:

Terminal, in /opt/apache-answer
(
  umask 077
  docker compose exec -T db sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" exec mysqldump --single-transaction --no-tablespaces -u answer answer' > answer-$(date +%F).sql
  docker compose exec -T answer tar -C /data -czf - . > data-$(date +%F).tar.gz
  cp .env env-$(date +%F).bak
  chmod 600 answer-*.sql data-*.tar.gz env-*.bak
)

Schedule this copy and send it off the server. Stored on the disk, the files are also included in the server’s nightly backups.

Restoring

On the same installation, or on a new one with the same compose.yaml and .env, stop the application, replace the database with an empty one, load the dump into it, put the files back, then start the application again:

Terminal, in /opt/apache-answer
docker compose stop answer &&
docker compose exec -T db sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" exec mysql -u answer -e "DROP DATABASE answer; CREATE DATABASE answer"' &&
docker compose exec -T db sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" exec mysql -u answer answer' < answer-2026-11-20.sql &&
docker compose run --rm --no-deps -T --entrypoint tar answer -C /data -xzf - < data-2026-11-20.tar.gz &&
docker compose start answer

We tested the whole cycle on our VPS with these exact commands: dump and archive, the database dropped and the data volume emptied, then the restore. The administrator signed in again at once, and the question came back with its page and its image, byte for byte.

Upgrades

Apache Answer publishes a release every few months, after a vote of the project, and the image follows on Docker Hub with the same number. Read the release notes, take a backup, change the image tag in compose.yaml, then pull the new image and recreate the container. At each start, the image runs answer upgrade before the application, which migrates the database:

Terminal, in /opt/apache-answer
docker compose pull
docker compose up -d
docker compose logs answer | grep -E "\[migrate\]|upgrade done|answer Version"

Who does what on a managed VPS

Self-hosting means running the server on top of the application. On a managed VPS, our teams take charge of the server and proactively monitor your instance; Apache Answer remains your software, with your community and your settings.

TopicOur teamsYou
The serverSystem and security updates, server interventions includedThe timing that suits you
MonitoringServer monitored 24/7, with intervention without waiting for your callYour questions, tags, members and moderation
Apache AnswerProactive monitoring: errors, slowdowns, database and disk space spotted, fix recommendedIts installation, upgrades, plugins and settings, which you apply, yourself or through your AI assistant
EmailThe SMTP relay and the deliverability of the serverThe SMTP settings in Apache Answer
BackupsEvery night, encrypted and kept off the machine; restores includedApache Answer’s own dumps and archives, and the restore request, when you need one
MigrationYour current server migrated, free of chargeThe timing of the switch

If you would rather have our teams work inside the application itself, that service is billed by the hour or at a fixed rate, with an estimate shared before the work starts.

Apache Answer, on a server run for you

With a Simafri Managed VPS, our teams keep your Apache Answer instance’s server up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is free.

Explore Managed VPS

Frequently asked questions

Is Apache Answer free?

Yes. Apache Answer is under the Apache-2.0 license: you can run it for your community, your company or your clients with no license to buy, and there is no paid edition. What remains is the cost of the server that runs it.

How do I install Apache Answer with Docker Compose?

Use the apache/answer image and MySQL 8.4 in a compose.yaml, put the two database passwords in a .env file, publish the port on 127.0.0.1 and run docker compose up -d. Complete the installer before the site is public, then put an HTTPS reverse proxy in front.

Should I use SQLite, MySQL or PostgreSQL?

The project recommends SQLite only to try Apache Answer, and MySQL for real use; PostgreSQL is supported too. Choose at installation: Apache Answer does not migrate data from one database to another.

Can I complete the installer without a browser?

Yes. The installer page calls three requests that you can send with curl from the server: the database check, the configuration file, then the site and the administrator. We installed our test instance this way, before opening HTTPS.

Why do new members not receive their confirmation email?

Apache Answer needs your SMTP relay to send them: set it under Admin, Settings, SMTP, then check it with a test message. Until then, no email leaves Apache Answer.

How much memory does Apache Answer need?

On our test VPS, a fresh installation used about 190 MB for Apache Answer and 490 MB for MySQL 8.4, and the two images take about 330 MB of disk.

How do I back up Apache Answer?

Dump the database with mysqldump --single-transaction --no-tablespaces, archive the /data volume with tar and keep a copy of your .env file, under umask 077 so that only root can read them. To restore, recreate the database empty, load the dump with mysql, put the archive back, then start Apache Answer.

How do I upgrade Apache Answer?

Read the release notes and take a backup, change the image tag in compose.yaml, then run docker compose pull and docker compose up -d. The image migrates the database at startup, and its log shows each migration.

Does a managed VPS cover Apache Answer?

A managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your instance and recommend useful fixes, which you apply. Work inside the application is billed by the hour or at a fixed rate.

Contact us