How to run anubis with nginx on ubuntu vps
Learn how to run anubis with nginx on ubuntu vps

This article provides a guide demonstrating how to run Anubis with Nginx on Ubuntu VPS.

A complete installation, reverse proxy, systemd, firewall, SSL, and hardening guide

Overview

This guide walks you through deploying Anubis (the open-source file analysis and malware sandbox tool) on an Ubuntu VPS, fronted by Nginx as a secure reverse proxy with HTTPS. You’ll install dependencies, run Anubis as a service, configure Nginx for production, and optionally enable a domain + SSL using Let’s Encrypt.

Tested on: Ubuntu 20.04 / 22.04 / 24.04
Stack: Anubis (API/Web UI) + Nginx + Systemd + UFW + Certbot

Launch 100% ssd ubuntu vps from $2. 49/mo!

How to Run Anubis with Nginx on Ubuntu VPS

To run Anubis with Nginx on Ubuntu VPS, follow the steps below:

  1. Update Server

    sudo apt update && sudo apt upgrade -y sudo apt install -y git curl wget unzip nano htop
  2. Install Required Dependencies for Anubis

    (Anubis is Python-based and requires Python 3.8+)

    sudo apt install -y python3 python3-pip python3-venv python3-dev build-essential libffi-dev libssl-dev

    Create a working directory:

    mkdir -p /opt/anubis cd /opt/anubis
  3. Download Anubis

    If you’re installing the open-source version:

    git clone https://github.com/jonluca/Anubis.git .
  4. Create Virtual Environment & Install Python Requirements

    python3 -m venv venv source venv/bin/activate pip install --upgrade pip pip install -r requirements.txt pip install numpy anubis
  5. Initialize Anubis

    Anubis includes a Flask-based API and runs on a local port.

    Test launch:

    python3 anubis.py

    If it shows “Running on http://127.0.0.1:5000”, it works.
    Stop it (CTRL+C).

  6. Create Systemd Service for Anubis

    This ensures Anubis runs automatically as a background service.

    Create file:

    sudo nano /etc/systemd/system/anubis.service

    Paste:

    [Unit] Description=Anubis Malware Analysis API After=network.target [Service] User=root WorkingDirectory=/opt/anubis Environment="PATH=/opt/anubis/venv/bin" ExecStart=/opt/anubis/venv/bin/python anubis.py Restart=always [Install] WantedBy=multi-user.target

    Enable + start:

    sudo systemctl daemon-reload sudo systemctl enable anubis sudo systemctl start anubis

    Check:

    sudo systemctl status anubis

    Anubis now runs on http://127.0.0.1:5000 as a service.

  7. Install Nginx

    sudo apt install nginx -y

    Check Nginx:

    systemctl status nginx
  8. Configure Nginx Reverse Proxy for Anubis

    Create a server block:

    sudo nano /etc/nginx/sites-available/anubis.conf

    Paste:

    server { listen 80; server_name YOUR_DOMAIN_OR_IP; client_max_body_size 500M; location / { proxy_pass http://127.0.0.1:5000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; } }

    Enable the site:

    sudo ln -s /etc/nginx/sites-available/anubis.conf /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl restart nginx

    Visit:

    http://YOUR_DOMAIN_OR_IP/

    You should see Anubis.

  9. Optional: Enable HTTPS via Let’s Encrypt (Strongly Recommended)

    Install Certbot:

    sudo apt install certbot python3-certbot-nginx -y

    Issue the certificate:

    sudo certbot --nginx -d yourdomain.com

    Certbot automatically injects SSL directives and reloads Nginx.

    Test auto-renew:

    sudo certbot renew --dry-run
  10. Harden Nginx for Production

    Edit the SSL config:

    sudo nano /etc/nginx/sites-available/anubis.conf

    Add inside server block when SSL is enabled:

    proxy_read_timeout 300; proxy_connect_timeout 300; proxy_send_timeout 300; add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; add_header Referrer-Policy "no-referrer-when-downgrade"; add_header X-XSS-Protection "1; mode=block";

    Reload:

    sudo systemctl reload nginx
  11. Configure Firewall (UFW)

    Allow SSH + Nginx:

    sudo ufw allow OpenSSH sudo ufw allow 'Nginx Full' sudo ufw --force enable
  12. Testing

    • Check systemd:

      sudo systemctl status anubis
    • Check Nginx:

      sudo nginx -t sudo systemctl restart nginx
    • Verify port listening:

      ss -ltnp | grep 5000
    • View logs:

      journalctl -u anubis -f
  13. Optional Enhancements

    • Enable Basic Authentication (Nginx)

      sudo apt install apache2-utils -y sudo htpasswd -c /etc/nginx/.htpasswd admin

      Add inside server block:

      auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd;

      Reload Nginx.

    • Run Anubis Behind HTTPS Only

      Force HTTPS:

      server { listen 80; server_name yourdomain.com; return 301 https://$host$request_uri; }

Final Result

You now have:

✓ Anubis installed
✓ Running under Python virtual environment
✓ Managed by systemd
✓ Secured by Nginx reverse proxy
✓ Optional domain + SSL
✓ Production-grade hardening
Launch 100% ssd ubuntu vps from $2. 49/mo!

Conclusion

You now know how to run Anubis with Nginx on Ubuntu VPS.

Avatar of editorial staff

Editorial Staff

Rad Web Hosting is a leading provider of web hosting, Cloud VPS, and Dedicated Servers in Dallas, TX.
lg