> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/ItzCrazyKns/Perplexica/llms.txt
> Use this file to discover all available pages before exploring further.

# Updating Perplexica

> Keep your Perplexica installation up to date with the latest features and fixes

Regular updates ensure you have the latest features, security patches, and bug fixes. The update process varies depending on your installation method.

<Note>
  Your settings and search history are automatically preserved during updates. All configuration is stored in the persistent data volume.
</Note>

## Docker (pre-built images)

If you're using the official Docker images from Docker Hub, updating is straightforward:

<Steps>
  <Step title="Pull the latest image">
    For the full image with bundled SearxNG:

    ```bash theme={null}
    docker pull itzcrazykns1337/perplexica:latest
    ```

    For the slim image:

    ```bash theme={null}
    docker pull itzcrazykns1337/perplexica:slim-latest
    ```
  </Step>

  <Step title="Stop the current container">
    ```bash theme={null}
    docker stop perplexica
    ```
  </Step>

  <Step title="Remove the old container">
    ```bash theme={null}
    docker rm perplexica
    ```

    This only removes the container, not your data. Your data is stored in the named volume and will be reused.
  </Step>

  <Step title="Start with the new image">
    For the full image:

    ```bash theme={null}
    docker run -d -p 3000:3000 -v perplexica-data:/home/perplexica/data --name perplexica itzcrazykns1337/perplexica:latest
    ```

    For the slim image:

    ```bash theme={null}
    docker run -d -p 3000:3000 -e SEARXNG_API_URL=http://your-searxng-url:8080 -v perplexica-data:/home/perplexica/data --name perplexica itzcrazykns1337/perplexica:slim-latest
    ```
  </Step>

  <Step title="Verify the update">
    Navigate to [http://localhost:3000](http://localhost:3000) and verify that the application is running correctly with your existing settings.
  </Step>
</Steps>

## Docker (building from source)

If you built your own Docker image from the repository:

<Steps>
  <Step title="Navigate to your repository">
    ```bash theme={null}
    cd Perplexica
    ```
  </Step>

  <Step title="Pull the latest changes">
    ```bash theme={null}
    git pull origin master
    ```
  </Step>

  <Step title="Rebuild the Docker image">
    ```bash theme={null}
    docker build -t perplexica .
    ```

    This may take several minutes depending on what changed.
  </Step>

  <Step title="Stop and remove the old container">
    ```bash theme={null}
    docker stop perplexica
    docker rm perplexica
    ```
  </Step>

  <Step title="Start the new container">
    ```bash theme={null}
    docker run -d -p 3000:3000 -v perplexica-data:/home/perplexica/data --name perplexica perplexica
    ```
  </Step>

  <Step title="Verify the update">
    Visit [http://localhost:3000](http://localhost:3000) and confirm everything is working as expected.
  </Step>
</Steps>

## Docker Compose

If you're using Docker Compose:

<CodeGroup>
  ```bash Using pre-built images theme={null}
  docker compose pull
  docker compose up -d
  ```

  ```bash Building from source theme={null}
  git pull origin master
  docker compose build
  docker compose up -d
  ```
</CodeGroup>

## Manual installation

For manual installations without Docker:

<Steps>
  <Step title="Navigate to your installation directory">
    ```bash theme={null}
    cd Perplexica
    ```
  </Step>

  <Step title="Pull the latest changes">
    ```bash theme={null}
    git pull origin master
    ```
  </Step>

  <Step title="Install new dependencies">
    ```bash theme={null}
    npm i
    ```

    This ensures any new packages are installed.
  </Step>

  <Step title="Rebuild the application">
    ```bash theme={null}
    npm run build
    ```
  </Step>

  <Step title="Restart the application">
    Stop your current instance (Ctrl+C if running in foreground, or kill the process), then:

    ```bash theme={null}
    npm run start
    ```

    If using PM2:

    ```bash theme={null}
    pm2 restart perplexica
    ```
  </Step>

  <Step title="Verify the update">
    Navigate to [http://localhost:3000](http://localhost:3000) and confirm your settings are preserved and the application is working correctly.
  </Step>
</Steps>

## One-click deployments

For cloud platform deployments, update procedures vary:

<AccordionGroup>
  <Accordion title="Sealos">
    Use the Sealos dashboard to update your application:

    1. Navigate to your Perplexica deployment
    2. Look for the update or redeploy option
    3. Select the latest version
    4. Apply the update
  </Accordion>

  <Accordion title="RepoCloud">
    RepoCloud may offer automatic updates:

    1. Check your deployment settings for auto-update options
    2. Or manually trigger an update from the dashboard
    3. Your data will be preserved automatically
  </Accordion>

  <Accordion title="ClawCloud">
    To update on ClawCloud:

    1. Access your deployment dashboard
    2. Look for update or rebuild options
    3. Or redeploy from the template to get the latest version
  </Accordion>

  <Accordion title="Hostinger VPS">
    SSH into your VPS and follow the Docker update instructions:

    ```bash theme={null}
    docker pull itzcrazykns1337/perplexica:latest
    docker compose down
    docker compose up -d
    ```
  </Accordion>
</AccordionGroup>

## Checking your version

To verify which version of Perplexica you're running:

1. Check the package.json version in your installation
2. Compare against the [latest release on GitHub](https://github.com/ItzCrazyKns/Perplexica/releases)
3. Check the Docker image tags on [Docker Hub](https://hub.docker.com/r/itzcrazykns1337/perplexica)

## Update best practices

<CardGroup cols={2}>
  <Card title="Backup your data" icon="database">
    Before major updates, consider backing up your data volume:

    ```bash theme={null}
    docker run --rm -v perplexica-data:/data -v $(pwd):/backup ubuntu tar czf /backup/perplexica-backup.tar.gz /data
    ```
  </Card>

  <Card title="Review changelogs" icon="list">
    Check the [GitHub releases](https://github.com/ItzCrazyKns/Perplexica/releases) page to see what's new and if any breaking changes require action.
  </Card>

  <Card title="Test after updating" icon="vial">
    After updating, run a few test searches to ensure everything works correctly, especially if you use specific features.
  </Card>

  <Card title="Monitor logs" icon="terminal">
    Watch the logs during and after the update:

    ```bash theme={null}
    docker logs -f perplexica
    ```
  </Card>
</CardGroup>

## Rollback procedure

If you encounter issues after an update:

### Docker (pre-built images)

```bash theme={null}
# Stop current container
docker stop perplexica
docker rm perplexica

# Run previous version (specify version tag)
docker run -d -p 3000:3000 -v perplexica-data:/home/perplexica/data --name perplexica itzcrazykns1337/perplexica:1.12.0
```

### Git-based installations

```bash theme={null}
# View available versions
git tag -l

# Checkout specific version
git checkout v1.12.0

# Rebuild
npm i
npm run build
npm run start
```

## Next steps

<CardGroup cols={2}>
  <Card title="Troubleshooting" icon="wrench" href="/deployment/troubleshooting">
    Resolve issues after updating
  </Card>

  <Card title="Join Discord" icon="discord" href="https://discord.gg/EFwsmQDgAu">
    Get help from the community
  </Card>
</CardGroup>
