Back to all templates
Invoice Ninja logo

Invoice Ninja

Application512MB+ RAM

Invoicing, quotes, and payment management

invoicingbillingpayments

Deploy Invoice Ninja in 3 Steps

1

Connect Your VPS

Add your server credentials to Server Compass

2

Select Invoice Ninja

Choose from our template library

3

Deploy & Configure

Fill in settings and click Deploy

No Docker knowledge required
Do It Yourself

Deploy Invoice Ninja via Command Line

Prefer the command line? Follow this step-by-step guide to deploy Invoice Ninja manually on your VPS.

1

Connect to Your Remote Server

Begin by establishing a secure connection to your server through the terminal.

terminal
# Access your VPS
ssh root@YOUR_SERVER_IP

# With SSH key authentication
ssh -i ~/.ssh/your-private-key root@YOUR_SERVER_IP

First time? Ensure Docker is installed first: curl -fsSL https://get.docker.com | sh

2

Set Up Your App Folder

Create a dedicated folder for your application files.

terminal
# Create and navigate to project directory
mkdir -p ~/apps/invoice-ninja
cd ~/apps/invoice-ninja
3

Set Up Docker Compose

Create the following docker-compose.yml in your project directory:

docker-compose.yml
services:
  web:
    image: nginx:alpine
    ports:
      - "8080:80"
    volumes:
      - invoiceninja_public:/var/www/app/public:ro
      - invoiceninja_storage:/var/www/app/storage:ro
    depends_on:
      - invoiceninja
    command: |
      /bin/sh -c "cat > /etc/nginx/conf.d/default.conf <<'EOF'
      server {
        listen 80;
        server_name _;
        root /var/www/app/public;
        index index.php index.html;
        client_max_body_size 100m;

        location / {
          try_files $$uri $$uri/ /index.php?$$query_string;
        }

        location ~ \.php$$ {
          try_files $$uri =404;
          fastcgi_split_path_info ^(.+\.php)(/.+)$$;
          fastcgi_pass invoiceninja:9000;
          fastcgi_index index.php;
          include fastcgi_params;
          fastcgi_param SCRIPT_FILENAME $$document_root$$fastcgi_script_name;
          fastcgi_param PATH_INFO $$fastcgi_path_info;
        }

        location ~ /\. {
          deny all;
        }
      }
      EOF
      nginx -g 'daemon off;'"
    restart: unless-stopped

  invoiceninja:
    image: invoiceninja/invoiceninja-debian:latest
    environment:
      - APP_URL=<your-app-url>
      - APP_KEY=<your-app-key>
      - APP_ENV=production
      - APP_DEBUG=false
      - [email protected]
      - IN_PASSWORD=<your-in-password>
      - DB_HOST=db
      - DB_DATABASE=ninja
      - DB_USERNAME=ninja
      - DB_PASSWORD=<your-db-password>
      - REQUIRE_HTTPS=false
    volumes:
      - invoiceninja_public:/var/www/app/public
      - invoiceninja_storage:/var/www/app/storage
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy

  db:
    image: mysql:8.0
    environment:
      - MYSQL_ROOT_PASSWORD=<your-db-root-password>
      - MYSQL_DATABASE=ninja
      - MYSQL_USER=ninja
      - MYSQL_PASSWORD=<your-db-password>
    volumes:
      - mysql_data:/var/lib/mysql
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -p$$MYSQL_ROOT_PASSWORD || exit 1"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s

volumes:
  invoiceninja_public:
  invoiceninja_storage:
  mysql_data:
Configuration Variables
PORTHost port(default: 8080)
APP_URLFull application URL with http:// (auto-populated)
APP_KEYLaravel app key (auto-generated)
IN_USER_EMAILInitial admin email(default: [email protected])
IN_PASSWORDInitial admin password
DB_PASSWORDDB password
4

Spin Up the Stack

Run Docker Compose to launch your application.

terminal
# Launch the stack
docker compose up -d

# Verify container status
docker compose ps

# Follow the logs
docker compose logs --follow
5

Open the Application Port

Configure UFW to allow traffic to your application.

terminal
# Allow the application port through firewall
sudo ufw allow 8080/tcp
sudo ufw reload

# Access your app at:
# http://your-server-ip:8080
Skip the Terminal

Make it simple with Server Compass.

Deploy Invoice Ninja with a beautiful UI instead. No SSH, no YAML editing, no terminal commands. Just click, configure, and deploy in under 3 minutes.

  • No terminal required
  • Point-and-click setup
  • Auto SSL certificates
  • Rolling deployments
  • Health monitoring
  • Instant rollbacks
Download Server Compass$29 one-time • Lifetime license

After Deployment

After deploying Invoice Ninja with Server Compass, complete these steps to finish setup

1

Create admin account

2

Configure company settings

Need help? Check out our documentation for detailed guides.

Invoice Ninja FAQ

Common questions about self-hosting Invoice Ninja

How do I deploy Invoice Ninja with Server Compass?

Simply download Server Compass, connect to your VPS, and select Invoice Ninja from the templates list. Fill in the required configuration and click Deploy. The entire process takes under 3 minutes.

What are the system requirements for Invoice Ninja?

Invoice Ninja requires a minimum of 512MB RAM. We recommend a VPS with at least 1024MB RAM for optimal performance. Any modern Linux server with Docker support will work.

Can I migrate my existing Invoice Ninja data?

Yes! Server Compass provides volume mapping that allows you to import existing data. You can also use standard Invoice Ninja backup and restore procedures.

How do I update Invoice Ninja to the latest version?

Server Compass makes updates easy. Simply click the Update button in your deployment dashboard, and the latest Invoice Ninja image will be pulled and deployed with zero downtime.

Is Invoice Ninja free to self-host?

Invoice Ninja is open-source software. You only pay for your VPS hosting (typically $5-20/month) and optionally Server Compass ($29 one-time). No subscription fees or per-seat pricing.

Ready to Self-Host Invoice Ninja?

Download Server Compass and deploy Invoice Ninja to your VPS in under 3 minutes. No Docker expertise required.

Download Server Compass