Back to Blog

ArangoDB on AWS: Automate Install, S3 Backup & Restore with Systemd

AI Transformation Lead
  • Database
  • DevOps
  • ArangoDB
  • AWS
  • ShellScript
  • Backup
  • S3
  • Systemd
ArangoDB automated backup and restore on AWS EC2 with S3 storage

Introduction

ArangoDB is a native multi-model database, documents, graphs, and key/value, accessible through a single query language (AQL). Running it on AWS EC2 requires disciplined automation: the database process, configuration management, daily backups to S3, and a tested restore path. This guide provides production-ready shell scripts for all four concerns.

The scripts target ArangoDB 3.6.5-1 on Ubuntu 18.04. For ArangoDB 3.12+ on Ubuntu 22.04, update the repository URL and package version in Step 1. All other scripts remain unchanged.

Installing the Latest Version of ArangoDB on Ubuntu 18.04

Visit the ArangoDB website to download the latest version of the database. As of this guide, the current version is 3.6.5-1. Below is a script to install and configure ArangoDB on an AWS EC2 server.

Important Precautions

Ensure that you stop the ArangoDB service and switch your application to maintenance mode before proceeding.

bash
#!/bin/bash sudo systemctl stop arangodb3.service sudo cp -r /etc/arangodb3/ ~/arango-config-backup curl -OL https://download.arangodb.com/arangodb36/DEBIAN/Release.key sudo apt-key add - < Release.key echo 'deb https://download.arangodb.com/arangodb36/DEBIAN/ /' | sudo tee /etc/apt/sources.list.d/arangodb.list sudo apt-get update sudo apt-get install arangodb3=3.6.5-1 sudo sed -i "s+endpoint = tcp://127.0.0.1:8529+endpoint = tcp://0.0.0.0:8529+g" /etc/arangodb3/arangod.conf sudo systemctl enable arangodb3.service sudo systemctl start arangodb3.service sudo systemctl status arangodb3.service sudo sysctl -w "vm.max_map_count=1024000"

Backup and Upload ArangoDB to Amazon S3

This script handles the backup of ArangoDB and its upload to Amazon S3 storage.

bash
#!/bin/sh NOWDATE=$(date +%Y-%m-%d) DIRNAME="Your directory name" BUCKETNAME="Your bucket name in S3" DATABASENAME="Your database name" mkdir -p "/home/ubuntu/backup/$DIRNAME" arangodump --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password 'yourpassword' --server.database $DATABASENAME --output-directory "/home/ubuntu/backup/$DIRNAME/" --compress-output --overwrite tar -czvf /home/ubuntu/backup/$NOWDATE-$DATABASENAME-backup.tar.gz -C /home/ubuntu/backup/$DIRNAME . aws s3 cp /home/ubuntu/backup/$NOWDATE-$DATABASENAME-backup.tar.gz s3://$BUCKETNAME/dbbackup/ aws s3 rm s3://$BUCKETNAME/dbbackup/$LASTDATE-$DATABASENAME-backup.tar.gz rm -rf /home/ubuntu/backup/$NOWDATE-$DATABASENAME-backup.tar.gz rm -rf /home/ubuntu/backup/$DIRNAME/*

Restore ArangoDB from Amazon S3

The following script details the procedure to restore ArangoDB from a backup stored on Amazon S3.

bash
#!/bin/sh DIRNAME="Your directory name" BUCKETNAME="Your bucket name in S3" DATABASENAME="Your database name" read -p "Please enter file date (YYYY-MM-DD):" FILE_NAME aws s3 cp s3://$BUCKETNAME/dbbackup/$FILE_NAME-$DATABASENAME-backup.tar.gz /home/ubuntu/backup/ tar -xzvf /home/ubuntu/backup/$FILE_NAME-$DATABASENAME-backup.tar.gz -C /home/ubuntu/backup/$DIRNAME arangorestore --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password 'yourpassword' --server.database $DATABASENAME --input-directory "/home/ubuntu/backup/$DIRNAME" --create-database rm -rf /home/ubuntu/backup/$FILE_NAME-$DATABASENAME-backup.tar.gz rm -rf /home/ubuntu/backup/$DIRNAME/*

Automating Backups with Systemd Services

Automate your backup tasks with systemd services for better management and reliability.

  1. Navigate to /etc/systemd/system and create backup.service and backup.timer.
  2. Configure the backup service file to run

the backup script. 3. Set the timer to execute the backup script at a specified time.

bash
[Unit] Description=Schedule ArangoDB backup service [Timer] OnCalendar=*-*-* 02:30:00 Unit=backup.service [Install] WantedBy=multi-user.target
bash
[Unit] Description=Run ArangoDB backup script [Service] ExecStart=/bin/bash /home/ubuntu/backup/backup.sh

After setting up these files, manage the services as follows:

sudo systemctl daemon-reload
sudo systemctl start backup.timer
sudo systemctl status backup.timer

With these steps, you will have a fully automated backup system on your server.

X / Twitter
LinkedIn
Facebook
WhatsApp
Telegram
AI Engineering for B2B

Stuck between an AI pilot and a system your team can run?

I join your engineering team and build the agent layer alongside you, covering architecture, MCP integration, evals, and production deployment. When the engagement ends, your team owns the system and keeps shipping.

12+ years shipping production systems

Senior engineer turned AI specialist. React, Next.js, AWS, agent orchestration.

Dubai-based, working with B2B teams worldwide

Direct collaboration across UAE, Europe, and US time zones.

AI agent teams that ship, not demos that stall

Discovery, role design, MCP integration, evals, and production deployment.

Questions about this piece

Follow-ups readers ask most often about the argument above.

  • The scripts in this guide were written for ArangoDB 3.6.5-1 on Ubuntu 18.04 and remain compatible with the 3.x series. For ArangoDB 3.12+, update the repository URL and package version in the install script. The backup tools (arangodump/arangorestore) and systemd patterns are unchanged.

  • The guide provides a shell script that uses arangodump to create compressed backups and the AWS CLI to upload them to S3. Automate it with a systemd timer set to run daily at 2:30 AM, which is more reliable than cron on modern Ubuntu.

  • Yes. The restore script downloads a backup tarball from S3 by date, extracts it, and runs arangorestore to reload all collections. Provide the backup date when prompted and the script handles the rest.

  • Stop the service, back up /etc/arangodb3/ config files, put your application in maintenance mode, and create a fresh arangodump backup of all databases. Only then run the upgrade script.

  • Systemd timers provide structured logging via journalctl, dependency management, and retry logic. They integrate with the service manager for better visibility into backup job status compared to silent cron entries.

Get practical AI and engineering playbooks

Weekly field notes on private AI, automation, and high-performance Next.js builds. Each edition is concise, implementation-ready, and tested in production work.

Open full subscription page

Get the latest insights on AI and full-stack development.