Skip to content

Deployment Examples

Johnny Knighten edited this page Nov 29, 2023 · 3 revisions

Prerequisites For All Deployment Types

Port Forwarding

Regardless if you use the default ports or specify custom ones, you must setup port forwarding on your router to allow incoming connections to the server. You may also need to setup firewall rules on your host machine to allow incoming connections to the server.

This guide is a very high level overview of port forwarding and may be a good starting point if you are new to port forwarding.

There are too many different routers and firewall setups to provide a single guide for port forwarding. If you need help with port forwarding, I would recommend searching for a guide for your specific router and setup.

Make sure you understand the security implications of opening ports on your router and firewall. If you are unsure, I would recommend paying for server hosting instead of taking the risk. When opening ports there is always a chance you could end up exposing your computer to bad actors ("hackers").

Examples

Docker Run

Docker run is mainly good for one off deployments or testing. It is not recommended for production deployments by itself, but combined with something like systemd it can be made production ready.

Below is an example of starting an instance of the ARK SA Server using docker run that has more configuration options than the quick start example.

# written for bash, but should work in other shells
$ docker run -d \
  --name ark-sa-server \
  -p 8888:8888/udp \
  -p 8889:8889/udp \
  -p 27016:27016/udp \
  -p 27021:27021/tcp \
  -v ark-sa-server:/ark-server \
  -e ARK_SERVER_NAME="\"Simple ARK SA Server\"" \
  -e ARK_GAME_PORT=8888 \
  -e ARK_QUERY_PORT=27016 \
  -e ARK_MAX_PLAYERS=20 \
  -e ARK_SERVER_PASSWORD=password2 \
  -e ARK_SERVER_ADMIN_PASSWORD=adminpassword2 \
  -e ARK_ENABLE_PVE=True \
  -e STEAMCMD_SKIP_VALIDATION=True \
  -e ARK_PREVENT_AUTO_UPDATE=True \
  -e ARK_RCON_ENABLED=True \
  -e ARK_RCON_PORT=27021 \
  -e ARK_MOD_LIST="\"927131, 893657\"" \
  -e ARK_SCHEDULED_RESTART=True \
  -e ARK_RESTART_CRON=0 4 * * 0,3 \
  -e ARK_SCHEDULED_UPDATE=True \
  -e ARK_UPDATE_CRON=0 5 * * 6 \
  johnnyknighten/ark-sa-server:1.0.0

Docker Run + Systemd

See deployment-examples\docker-run-with-systemd details about using docker run with Systemd to run the server as service on a Linux server(that uses Systemd).

Docker Compose

Below is a minimal example of starting an instance of the ARK SA Server using docker compose.

---
version: '3'
services:
  ark-sa:
    container_name: ark
    image: johnnyknighten/ark-sa-server:latest
    restart: unless-stopped
    environment:
      - ARK_SERVER_NAME="Simple ARK SA Server"
      - ARK_SERVER_ADMIN_PASSWORD=secretpassword
    volumes:
      - 'ark-files:/ark-server'
    ports:
      - 7777:7777/udp
      - 7778:7778/udp
      - 27015:27015/udp
      - 27020:27020/tcp
volumes:
  ark-files:

See the deployment-examples\docker-compose folder for more docker compose examples.