Skip to main content

Overview

Invenicum is designed to be self-hosted and can be deployed in several ways. This guide covers all deployment methods, from the simplest Docker Compose setup to standalone Docker containers.
Recommended Method: We recommend using Docker Compose for most users, as it handles both the application and database setup automatically.

Prerequisites

Before installing Invenicum, ensure you have:
  • Docker (version 20.10 or higher) and Docker Compose (version 2.0 or higher)
  • Google Gemini API Key - Get one free here
  • At least 2GB of RAM and 5GB of disk space
  • A supported platform: Linux, macOS, or Windows with WSL2

Installation Methods

Environment Variables

Here’s a complete reference of all environment variables used by Invenicum:
VariableRequiredDefaultDescription
DB_URLYes-PostgreSQL connection string (format: postgres://user:pass@host:port/dbname)
AI_PROVIDERYesgeminiAI provider (currently only gemini is supported)
GEMINI_API_KEYYes-Your Google Gemini API key for AI features
API_URLYeshttp://localhost:3000Base URL where the API is accessible
PORTNo3000Port the application listens on
NODE_ENVNoproductionEnvironment mode (development or production)

Frontend Environment Variables

When building the Flutter app, you can configure:
VariableDefaultDescription
API_URLhttp://192.168.1.43:3000Backend API URL (set via --dart-define)
For production deployments, always override the default API_URL to point to your actual server.

Database Setup

PostgreSQL Requirements

  • Version: PostgreSQL 12 or higher (15 recommended)
  • Storage: At least 1GB free space (grows with your collection)
  • Encoding: UTF-8

Manual Database Setup

If you’re using an external PostgreSQL server:
CREATE DATABASE invenicum;
CREATE USER invenicum WITH ENCRYPTED PASSWORD 'your_secure_password';
GRANT ALL PRIVILEGES ON DATABASE invenicum TO invenicum;
Then construct your connection string:
postgres://invenicum:your_secure_password@your-db-host:5432/invenicum

Gemini API Configuration

Getting Your API Key

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Click “Create API Key”
  4. Copy the key and add it to your environment variables

API Key Limits

The free tier includes:
  • 15 requests per minute
  • 1,500 requests per day
  • Suitable for personal use and small teams
For higher limits, check Google’s pricing page.
Keep Your API Key Secret: Never commit your API key to version control or share it publicly. Anyone with your key can use your Gemini quota.

Network Configuration

Accessing from Other Devices

To access Invenicum from other devices on your network:
  1. Update the API_URL environment variable to use your server’s IP:
    - API_URL=http://192.168.1.100:3000
    
  2. Ensure port 3000 is accessible through your firewall:
    # For Ubuntu/Debian
    sudo ufw allow 3000/tcp
    

Reverse Proxy Setup

For production deployments with HTTPS, use a reverse proxy like Nginx or Traefik:
server {
    listen 80;
    server_name invenicum.example.com;

    location / {
        proxy_pass http://localhost:3000;
        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;
    }
}

Troubleshooting

Database Connection Failed

If you see database connection errors:
  1. Verify the DB_URL format is correct
  2. Check that PostgreSQL is running: docker-compose ps
  3. Ensure the database user has proper permissions
  4. Check the logs: docker-compose logs db

AI Features Not Working

If AI features aren’t responding:
  1. Verify your GEMINI_API_KEY is correct
  2. Check you haven’t exceeded rate limits
  3. Ensure your API key is active in Google AI Studio
  4. Review application logs for specific error messages

Port Already in Use

If port 3000 is already occupied:
  1. Change the port mapping in docker-compose.yml:
    ports:
      - "8080:3000"  # Access via port 8080 instead
    
  2. Update your API_URL accordingly:
    - API_URL=http://localhost:8080
    

Next Steps

Now that Invenicum is installed:

Quick Start

Create your first collection and add items

Configuration

Customize Invenicum to fit your needs

Build docs developers (and LLMs) love