> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openinary.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy on Coolify

> Step-by-step guide to deploy Openinary on Coolify

## Prerequisites

* A Coolify account with access to a server
* Docker support enabled on your Coolify instance

## Deployment Steps

<Steps>
  <Step title="Create or access your project">
    If you don't have a project yet, create a new one in Coolify. Navigate to your project dashboard once created.
  </Step>

  <Step title="Create a new resource">
    In your project, create a new resource. In the "New Resource" page, select **Docker Image** from the **Docker Based** section.

    Enter the following Docker image name:

    ```bash theme={null}
    openinary/openinary
    ```
  </Step>

  <Step title="Configure exposed ports">
    In the **General** configuration section:

    1. Locate the **Ports Exposes** field
    2. Enter the port `3000`
    3. Click **Save**
  </Step>

  <Step title="Configure environment variables">
    Navigate to **Environment Variables** in the sidebar, switch to "Developer View"  and add the following variables:

    ```bash theme={null}
    BETTER_AUTH_SECRET=your-sha256-hash-or-long-secret
    BETTER_AUTH_URL=your-coolify-generated-url-or-domain
    IMAGE_TAG=latest
    NODE_ENV=production
    PORT=3000
    ```

    <Note>
      For `BETTER_AUTH_URL`, use the URL generated by Coolify in the **General** tab under **Domains**.
    </Note>

    <Tabs>
      <Tab title="Local Storage">
        If you're using local file storage, no additional environment variables are needed for storage.
      </Tab>

      <Tab title="S3-Compatible Storage">
        If you want to use cloud storage, add your S3-compatible bucket configuration:

        ```bash theme={null}
        STORAGE_REGION=your-region
        STORAGE_ACCESS_KEY_ID=your-access-key
        STORAGE_SECRET_ACCESS_KEY=your-secret-key
        STORAGE_BUCKET_NAME=your-bucket-name
        STORAGE_ENDPOINT=https://your-s3-endpoint.com
        ```

        See the [Storage configuration](/configuration/storage) page for detailed setup instructions.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Configure persistent storage">
    Navigate to **Persistent Storage** and add the following volume mounts:

    ### Required volume

    <ParamField path="db-data" type="Volume Mount" required>
      **Destination Path**: `/app/data`

      Stores the internal Openinary database (admin accounts, API keys, metadata).
    </ParamField>

    ### Storage volumes (if not using S3)

    <Warning>
      If you're **not** using S3-compatible cloud storage, you must also add these two volumes to persist your files and cache.
    </Warning>

    <ParamField path="public-files" type="Volume Mount">
      **Destination Path**: `/app/apps/api/public`

      Stores original uploaded assets and media files.
    </ParamField>

    <ParamField path="cache-data" type="Volume Mount">
      **Destination Path**: `/app/apps/api/cache`

      Stores optimized and transformed assets in cache for faster delivery.
    </ParamField>

    <Note>
      These volume mounts are essential for data persistence across deployments. Without them, your data will be lost during container restarts or updates.
    </Note>
  </Step>

  <Step title="Deploy your application">
    Once all configurations are set, click the **Deploy** button to start your Openinary instance.

    <Check>
      Your Openinary instance should now be deploying. Monitor the deployment logs to ensure everything starts correctly.
    </Check>
  </Step>

  <Step title="Initial setup">
    Once deployed, visit your Coolify-generated URL or custom domain. You should land on the initial setup page where you can create your administrator account.

    <Warning>
      **Important**: Create your admin account immediately after deployment, as the setup route is publicly accessible until completed.
    </Warning>

    After signing in, you should see the sample assets or your bucket content in the Dashboard.
  </Step>
</Steps>

## Troubleshooting

If you encounter any issues during deployment:

1. Check the deployment logs in Coolify for error messages
2. Verify all environment variables are correctly set
3. Ensure your domain DNS is properly configured (if using a custom domain)

If problems persist, please [create an issue on GitHub](https://github.com/openinary/openinary/issues) with your deployment logs.

## Next Steps

Now that your Openinary instance is running, learn how to use it:

<CardGroup cols={2}>
  <Card title="Transform Images" icon="image" href="/media-transformations/image-transformations">
    Learn how to transform and optimize images
  </Card>

  <Card title="Transform Videos" icon="video" href="/media-transformations/video-transformations">
    Learn how to transform and process videos
  </Card>
</CardGroup>
