Skip to main content

Configure external PostgreSQL, Redis and S3 storage

The Prime CLI lets you easily configure your Commercial Edition instance, providing options to customize the PostgreSQL database, Redis, external storage, and other advanced settings.

  1. Run the Prime CLI:

    sudo prime-cli
  2. Once the CLI is running, enter configure to start a step-by-step form where you can specify:

    • Listening port: Port for the built-in reverse proxy. Default: 80

    • Max file-upload size: Maximum file size (in MB) that members can upload. Default: 5 MB

    • External Postgres URL: URL of your external PostgreSQL instance. Default: Postgres 15.5 in Docker.

      warning

      Do not use a database on your local machine. If you use localhost in the URL, it will not work. Use a network-accessible server.

      Avoid special characters in your PostgreSQL password.

    • External Redis URL: URL of your external Redis instance. Default: Redis 7.2.4

    • External storage: Only S3-compatible storages are supported. Default: MinIO

      1. Ensure your IAM user has the following permissions on your S3 bucket:
        • s3:GetObject: Access objects.
        • s3:PutObject: Upload new assets using presigned URLs.
      2. Configure the CORS policy on your bucket to enable presigned uploads. Replace <YOUR_DOMAIN> with your actual domain:
        [
        {
        "AllowedHeaders": ["*"],
        "AllowedMethods": ["GET", "POST", "PUT", "DELETE", "HEAD"],
        "AllowedOrigins": ["<YOUR_DOMAIN>"],
        "ExposeHeaders": ["ETag", "x-amz-server-side-encryption", "x-amz-request-id", "x-amz-id-2"],
        "MaxAgeSeconds": 3000
        }
        ]
      3. Switch to your external storage by providing:
        • S3 access key ID
        • S3 secret access key
        • S3 bucket name
        • S3 region
        • S3 endpoint URL
  3. After confirming your choices, your instance will automatically restart with the updated configuration.

Community Edition

To configure external Postgres, Redis, and S3 storage for the Plane Community Edition, adjust the environment variables in plane.env as follows:

  1. Open the plane.env file on your server.

  2. In the DB SETTINGS section, update the variables to connect to your external Postgres instance:

    # DB SETTINGS
    PGHOST=your-external-postgres-host # Hostname or IP address of your Postgres server.
    PGDATABASE= # Leave blank when using external database.
    POSTGRES_USER=your-postgres-username # Username for Postgres.
    POSTGRES_PASSWORD=your-postgres-password # Password for the Postgres user.
    POSTGRES_DB=your-database-name # Database Plane should connect to.
    POSTGRES_PORT=5432 # Port for Postgres (usually 5432).
    PGDATA=/var/lib/postgresql/data # No need to change for external Postgres.
    DATABASE_URL= # Leave empty if using the above variables. If using DATABASE_URL, leave others empty.
    warning

    Do not use a database on your local machine. If you use localhost in the URL, it will not work. Use a network-accessible server.

    Avoid special characters in your PostgreSQL password.

  3. In the REDIS SETTINGS section, update the variables for your external Redis instance:

    # REDIS SETTINGS
    REDIS_HOST=your-external-redis-host # Hostname or IP of the Redis server.
    REDIS_PORT=6379 # Port for Redis (default 6379).
    REDIS_URL= # Leave empty if using the above variables. If using REDIS_URL, leave others empty.
  4. In the DATA STORE SETTINGS section, update the variables for any S3-compatible storage:

    # DATA STORE SETTINGS
    USE_MINIO=0 # Set to 0 for external S3, 1 for MinIO (default).
    AWS_REGION=your-s3-region # For AWS, set the region, e.g., "us-west-1".
    AWS_ACCESS_KEY_ID=your-s3-access-key # Access key for S3.
    AWS_SECRET_ACCESS_KEY=your-s3-secret-key # Secret key for S3.
    AWS_S3_ENDPOINT_URL=https://your-s3-endpoint # S3 API endpoint URL (e.g., "https://s3.amazonaws.com" for AWS).
    AWS_S3_BUCKET_NAME=your-s3-bucket-name # S3 bucket name for Plane data.
    MINIO_ROOT_USER= # Leave blank for external S3.
    MINIO_ROOT_PASSWORD= # Leave blank for external S3.
    BUCKET_NAME= # Leave blank for external S3.
    FILE_SIZE_LIMIT=5242880 # Max file upload size in bytes (5MB here).
  5. Save your changes to plane.env.

  6. Restart Plane services to apply the new settings using the setup.sh script.