How to Deploy Snipe-IT on a VPS
Updated Nov 2026
verified on Ubuntu 26.04 · Nov 2026Self-host Snipe-IT asset management with the official Docker Compose stack and MariaDB behind Caddy HTTPS, a first admin, backup and restore.
- A VPS with 2 GB+ RAM (the catalog floor is 1 GB; the app and MariaDB share the box)
- A fresh Ubuntu 24.04 or 26.04 server with root/sudo SSH access
- A domain or subdomain you can point at the server
- An SMTP account if you want Snipe-IT to send email
What Snipe-IT is
Snipe-IT tracks IT assets: hardware, software licences, accessories and consumables, and who each item is checked out to. It is AGPL-3.0, a Laravel (PHP) application on MariaDB.
This guide uses the project's own Compose file and environment template, pinned
to release v8.8.4, puts Caddy in front, completes the setup wizard before the
site is public, and takes a backup you restore.
Server sizing
The catalog floor is 1 GB of RAM; on the catalog's test box Snipe-IT idled at 191 MB and the install used about 2 GB of disk. Imports, reports and backups use more than idle. Disk grows with the database and uploaded files.
For choosing a provider and tier, see Best VPS for self-hosting.
Prepare the server
Update the system and install the few tools this guide uses:
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install -y curl openssl ufw dnsutils
Working as root? Create a sudo user first and continue as that user:
adduser deploy
usermod -aG sudo deploy
Open SSH and the two ports the reverse proxy needs:
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw --force enable
The override file below binds the app to 127.0.0.1, and MariaDB publishes nothing. Docker publishes container ports around ufw, so a port bound to
all interfaces would be reachable from the internet whatever the firewall says.
Paid link — we earn a commission if you shop through it.
Install Docker
The convenience script installs Docker Engine and the Compose plugin (Docker and Compose on Ubuntu explains the details):
command -v docker >/dev/null || curl -fsSL https://get.docker.com | sudo sh
sudo docker compose version
Install Snipe-IT
Download the Compose file and environment template from the release tag:
mkdir -p ~/snipeit && cd ~/snipeit
BASE=https://raw.githubusercontent.com/grokability/snipe-it/v8.8.4
[ -s docker-compose.yml ] || curl -fsSL --retry 5 -o docker-compose.yml $BASE/docker-compose.yml
[ -s .env ] || curl -fsSL --retry 5 -o .env $BASE/.env.docker
chmod 600 .env
ls -l docker-compose.yml .env
Fill in the environment. The template ships a sample APP_KEY and sample
database passwords, so all three are replaced. The guard makes the step safe to
re-run: changing them after the database exists would lock the app out. Set your
own hostname and admin email:
cd ~/snipeit
if [ ! -f admin.env ]; then
( umask 077
{
echo "DOMAIN=assets.example.com"
echo "ADMIN_EMAIL=admin@example.com"
echo "ADMIN_PASSWORD=$(openssl rand -hex 12)"
} > admin.env )
. ./admin.env
sed -i "s|^APP_VERSION=.*|APP_VERSION=v8.8.4|
s|^APP_KEY=.*|APP_KEY=base64:$(openssl rand -base64 32)|
s|^APP_URL=.*|APP_URL=https://$DOMAIN|
s|^APP_TRUSTED_PROXIES=.*|APP_TRUSTED_PROXIES=172.16.0.0/12,192.168.0.0/16|
s|^DB_PASSWORD=.*|DB_PASSWORD=$(openssl rand -hex 16)|
s|^MYSQL_ROOT_PASSWORD=.*|MYSQL_ROOT_PASSWORD=$(openssl rand -hex 16)|" .env
fi
grep -E '^(APP_VERSION|APP_URL|APP_TRUSTED_PROXIES)=' .env
APP_KEY encrypts data in the database. Keep a copy of .env somewhere safe:
without that key an otherwise good backup cannot be fully read.
An override file leaves the upstream file untouched, binds the app to loopback
and adds Caddy. !override replaces the upstream port list instead of adding to
it:
cd ~/snipeit
. ./admin.env
cat > docker-compose.override.yml <<'EOF'
services:
app:
ports: !override ["127.0.0.1:8000:80"]
caddy:
image: caddy:2
restart: always
ports: ["80:80", "443:443"]
volumes: ["./Caddyfile:/etc/caddy/Caddyfile:ro", "caddy_data:/data"]
depends_on: [app]
volumes:
caddy_data:
EOF
cat > Caddyfile <<EOF
$DOMAIN {
encode zstd gzip
reverse_proxy app:80
}
EOF
Create the admin account
A fresh Snipe-IT shows a setup wizard to whoever opens it first, and the wizard
creates the superuser. Start only the app and database, and complete it over the
loopback port before Caddy runs. Snipe-IT answers 400 to a request whose Host
header does not match APP_URL, so the commands send that header:
cd ~/snipeit
sudo docker compose up -d app
. ./admin.env
code=000
for i in $(seq 1 90); do
code=$(curl -s -o /dev/null -w '%{http_code}' -H "Host: $DOMAIN" http://127.0.0.1:8000/setup/user)
[ "$code" = "200" ] && break
sleep 3
done
echo "setup page: HTTP $code"
The next block submits the wizard's "create first user" form, including its CSRF token. Change the names and site name to taste:
cd ~/snipeit
. ./admin.env
jar=$(mktemp)
token=$(curl -s -c "$jar" -b "$jar" -H "Host: $DOMAIN" http://127.0.0.1:8000/setup/user | grep -o 'name="_token" value="[^"]*"' | head -1 | cut -d'"' -f4)
curl -s -c "$jar" -b "$jar" -o /dev/null -w 'wizard: %{http_code} -> %{redirect_url}\n' -H "Host: $DOMAIN" http://127.0.0.1:8000/setup/user \
--data-urlencode "_token=$token" \
--data-urlencode "site_name=Asset Inventory" \
--data-urlencode "first_name=Site" --data-urlencode "last_name=Admin" \
--data-urlencode "username=admin" --data-urlencode "email=$ADMIN_EMAIL" \
--data-urlencode "password=$ADMIN_PASSWORD" --data-urlencode "password_confirmation=$ADMIN_PASSWORD" \
--data-urlencode "locale=en-US" --data-urlencode "default_currency=USD"
rm -f "$jar"
A 302 to /setup/done means the account was saved; after that, /setup only
redirects away. Now that the instance is
claimed, mark cookies HTTPS-only and start Caddy:
cd ~/snipeit
sed -i 's|^SECURE_COOKIES=.*|SECURE_COOKIES=true|' .env
sudo docker compose up -d
sudo docker compose ps
HTTPS and domain
Create an A record for your hostname (this guide uses assets.example.com) pointing at
the server's public IP, and check that it resolves:
dig +short assets.example.com
Caddy requests the certificate once the name resolves and renews it by itself (see Automatic HTTPS with Caddy). Wait for it, with a bounded loop so a broken setup fails instead of hanging:
cd ~/snipeit
. ./admin.env
out=000
for i in $(seq 1 40); do
out=$(curl -s -o /dev/null -w '%{http_code} %{ssl_verify_result}' "https://$DOMAIN/login")
[ "$out" = "200 0" ] && break
sleep 5
done
echo "HTTPS status and certificate check: $out"
[ "$out" = "200 0" ]
200 0 means the page answered and the certificate verified.
Then sign in over HTTPS the way a browser does:
cd ~/snipeit
. ./admin.env
cat > check-login.sh <<'EOF'
. ./admin.env
jar=$(mktemp)
token=$(curl -s -c "$jar" -b "$jar" "https://$DOMAIN/login" | grep -o 'name="_token" value="[^"]*"' | head -1 | cut -d'"' -f4)
curl -s -c "$jar" -b "$jar" -o /dev/null "https://$DOMAIN/login" \
--data-urlencode "_token=$token" --data-urlencode "username=admin" --data-urlencode "password=$ADMIN_PASSWORD"
curl -s -b "$jar" -o /dev/null -w 'dashboard when signed in: %{http_code} %{url_effective}\n' -L "https://$DOMAIN/"
rm -f "$jar"
EOF
bash check-login.sh
A 200 on your site's root, not /login, means the sign-in worked. Open
https://assets.example.com, sign in as admin with the password from
~/snipeit/admin.env, and change it.
Email is not configured: the template points at a placeholder mail host, so
password resets, check-out notices and alerts will not arrive. Set MAIL_HOST,
MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, MAIL_FROM_ADDR and
MAIL_REPLYTO_ADDR in .env, then sudo docker compose up -d. This guide does
not test mail delivery.
Backups
php artisan snipeit:backup writes a zip with a SQL dump and uploaded files
into /var/lib/snipeit/dumps, adding a snipe-it- prefix to the name you give.
Run it, copy the zip out of the container, and save .env next to it, since the
zip is not a substitute for your APP_KEY:
cd ~/snipeit
sudo docker compose exec -T app php artisan snipeit:backup --filename=guide-backup.zip
sudo docker compose cp app:/var/lib/snipeit/dumps/snipe-it-guide-backup.zip ~/snipeit-backup-$(date +%F).zip
sudo chown "$USER": ~/snipeit-backup-$(date +%F).zip
chmod 600 ~/snipeit-backup-$(date +%F).zip
( umask 077; tar czf ~/snipeit-config-$(date +%F).tar.gz .env admin.env docker-compose.yml docker-compose.override.yml Caddyfile )
ls -l ~/snipeit-backup-*.zip ~/snipeit-config-*.tar.gz
Copy both files off the server and schedule the pair with cron.
Restore
This destroys the current data volumes and rebuilds them from the zip, which is the real test of a backup. Rehearse it right after taking one, before there is anything you cannot lose, with the zip already copied off the server:
cd ~/snipeit
test -s ~/snipeit-backup-$(date +%F).zip && sudo docker compose down && sudo docker volume rm snipeit_db_data snipeit_storage
sudo docker compose up -d app
. ./admin.env
for i in $(seq 1 90); do
[ "$(curl -s -o /dev/null -w '%{http_code}' -H "Host: $DOMAIN" http://127.0.0.1:8000/setup)" = "200" ] && break
sleep 3
done
sudo docker compose cp ~/snipeit-backup-$(date +%F).zip app:/tmp/restore.zip
sudo docker compose exec -T -u root app chmod 644 /tmp/restore.zip
sudo docker compose exec -T app php artisan snipeit:restore --force --no-progress /tmp/restore.zip
Restart everything and sign in again:
cd ~/snipeit
sudo docker compose up -d
sudo docker compose restart app
. ./admin.env
for i in $(seq 1 60); do
[ "$(curl -s -o /dev/null -w '%{http_code}' -H "Host: $DOMAIN" http://127.0.0.1:8000/login)" = "200" ] && break
sleep 3
done
sleep 5
bash check-login.sh
Restoring signs everyone out and does not touch .env. On a new server, unpack
the config archive into ~/snipeit first, so the same APP_KEY is used.
Upgrades
Read the release notes, take
a backup, set the new tag in APP_VERSION in .env, then:
cd ~/snipeit
sudo docker compose pull
sudo docker compose up -d
sudo docker compose logs --tail 20 app
The container runs database migrations when it starts. They are one-way, so the backup comes first. The MariaDB image tag comes from the upstream Compose file; compare it when you move to a newer release, and treat a database major upgrade as its own job.
Troubleshooting
502 from Caddy. The first start runs many migrations; follow
sudo docker compose logs app.
"419 Page Expired" or login loops. APP_URL must be the HTTPS address you
browse to, and APP_TRUSTED_PROXIES must cover the Docker network.
The container exits asking for an APP_KEY. The key line in .env is empty
or was removed.
No certificate. Check the DNS record and that inbound 80 and 443 are open at your provider too.
Verification and next steps
You are done when https://assets.example.com loads with a valid certificate,
you can sign in, you have restored a backup once, and .env is stored safely
off the server. See the Snipe-IT entry.
Next steps
Common questions
How long does it take to follow "How to Deploy Snipe-IT on a VPS"?
We estimate about 30 minutes of hands-on time for "How to Deploy Snipe-IT on a VPS"; this is an editorial estimate, not a measurement.
Was the "How to Deploy Snipe-IT on a VPS" guide tested?
The "How to Deploy Snipe-IT on a VPS" guide was verified end-to-end on Ubuntu 26.04 (Nov 2026).