Skip to main content
This setup is only meant for personal use or testing. It runs on SQLite3 and an in-memory Redis queue, which supports only a single instance on a single machine. For production or multi-instance setups, you must use Docker Compose with PostgreSQL and Redis.
To get up and running quickly with NRAI, we will use the NRAI Docker image. Follow these steps:

Prerequisites

You need to have Git and Docker installed on your machine in order to set up NRAI via Docker Compose.

Install

Pull Image and Run Docker image

Pull the NRAI Docker image and run the container with the following command:
docker run -d -p 8080:80 -v ~/.NRAI:/root/.NRAI -e AP_REDIS_TYPE=MEMORY -e AP_DB_TYPE=SQLITE3 -e AP_FRONTEND_URL="http://localhost:8080" NRAI/NRAI:latest

Configure Webhook URL (Important for Triggers, Optional If you have public IP)

Note: By default, NRAI will try to use your public IP for webhooks. If you are self-hosting on a personal machine, you must configure the frontend URL so that the webhook is accessible from the internet. Optional: The easiest way to expose your webhook URL on localhost is by using a service like ngrok. However, it is not suitable for production use.
  1. Install ngrok
  2. Run the following command:
ngrok http 8080
  1. Replace AP_FRONTEND_URL environment variable in the command line above.
Ngrok

Upgrade

Please follow the steps below: Before proceeding with the upgrade, it is always a good practice to back up your NRAI data to avoid any potential data loss during the update process.
  1. Stop the Current NRAI Container: If your NRAI container is running, stop it using the following command:
    docker stop nrai_container_name
    
  2. Backup NRAI Data Directory: By default, NRAI data is stored in the ~/.NRAI directory on your host machine. Create a backup of this directory to a safe location using the following command:
    cp -r ~/.NRAI ~/.NRAI_backup
    

Step 2: Update the Docker Image

  1. Pull the Latest NRAI Docker Image: Run the following command to pull the latest NRAI Docker image from Docker Hub:
    docker pull NRAI/NRAI:latest
    

Step 3: Remove the Existing NRAI Container

  1. Stop and Remove the Current NRAI Container: If your NRAI container is running, stop and remove it using the following commands:
    docker stop nrai_container_name
    docker rm nrai_container_name
    

Step 4: Run the Updated NRAI Container

Now, run the updated NRAI container with the latest image using the same command you used during the initial setup. Be sure to replace nrai_container_name with the desired name for your new container.
docker run -d -p 8080:80 -v ~/.NRAI:/root/.NRAI -e AP_REDIS_TYPE=MEMORY -e AP_DB_TYPE=SQLITE3 -e AP_FRONTEND_URL="http://localhost:8080" --name nrai_container_name NRAI/NRAI:latest
Congratulations! You have successfully upgraded your NRAI Docker deployment