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

# Updating Open WebUI

> Keep your Open WebUI installation up-to-date

Regularly update Open WebUI to get the latest features, bug fixes, and security patches.

## Before Updating

<Warning>
  Always backup your data before updating to prevent data loss in case of issues.
</Warning>

### Backup Your Data

<CodeGroup>
  ```bash Docker Volume theme={null}
  # Create backup directory
  mkdir -p ~/open-webui-backups

  # Backup the data volume
  docker run --rm \
    -v open-webui:/data \
    -v ~/open-webui-backups:/backup \
    alpine tar czf /backup/open-webui-backup-$(date +%Y%m%d-%H%M%S).tar.gz -C /data .
  ```

  ```bash Python/pip Installation theme={null}
  # Backup data directory
  tar czf open-webui-backup-$(date +%Y%m%d-%H%M%S).tar.gz ~/.local/share/open-webui/
  ```

  ```bash Custom Data Directory theme={null}
  # Backup custom data directory
  tar czf open-webui-backup-$(date +%Y%m%d-%H%M%S).tar.gz /path/to/your/data
  ```
</CodeGroup>

## Docker Updates

### Standard Docker Installation

<Steps>
  <Step title="Stop the Container">
    ```bash theme={null}
    docker stop open-webui
    ```
  </Step>

  <Step title="Remove the Container">
    ```bash theme={null}
    docker rm open-webui
    ```
  </Step>

  <Step title="Pull Latest Image">
    ```bash theme={null}
    docker pull ghcr.io/open-webui/open-webui:main
    ```
  </Step>

  <Step title="Start New Container">
    Run the same docker run command you used initially. For example:

    ```bash theme={null}
    docker run -d -p 3000:8080 \
      --add-host=host.docker.internal:host-gateway \
      -v open-webui:/app/backend/data \
      --name open-webui \
      --restart always \
      ghcr.io/open-webui/open-webui:main
    ```
  </Step>
</Steps>

### One-Line Update Script

Create an update script for convenience:

```bash update-open-webui.sh theme={null}
#!/bin/bash
set -e

echo "Updating Open WebUI..."

# Stop and remove container
docker stop open-webui
docker rm open-webui

# Pull latest image
docker pull ghcr.io/open-webui/open-webui:main

# Start new container
docker run -d -p 3000:8080 \
  --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data \
  --name open-webui \
  --restart always \
  ghcr.io/open-webui/open-webui:main

echo "Update complete!"
```

Make it executable and run:

```bash theme={null}
chmod +x update-open-webui.sh
./update-open-webui.sh
```

### Using Watchtower for Automatic Updates

Watchtower automatically updates running Docker containers:

```bash theme={null}
docker run -d \
  --name watchtower \
  -v /var/run/docker.sock:/var/run/docker.sock \
  containrrr/watchtower \
  --cleanup \
  --interval 86400 \
  open-webui
```

This checks for updates daily and automatically updates the `open-webui` container.

## Docker Compose Updates

<Steps>
  <Step title="Pull Latest Images">
    ```bash theme={null}
    docker compose pull
    ```
  </Step>

  <Step title="Restart Services">
    ```bash theme={null}
    docker compose up -d
    ```
  </Step>
</Steps>

### Docker Compose Update Script

```bash update-compose.sh theme={null}
#!/bin/bash
set -e

echo "Updating Open WebUI via Docker Compose..."

# Pull latest images
docker compose pull

# Restart with new images
docker compose up -d

# Clean up old images
docker image prune -f

echo "Update complete!"
```

## Kubernetes Updates

### Update Deployment Image

<Steps>
  <Step title="Update Image Tag">
    Edit your deployment manifest or use kubectl:

    ```bash theme={null}
    kubectl set image deployment/open-webui \
      open-webui=ghcr.io/open-webui/open-webui:main \
      -n open-webui
    ```
  </Step>

  <Step title="Monitor Rollout">
    ```bash theme={null}
    kubectl rollout status deployment/open-webui -n open-webui
    ```
  </Step>

  <Step title="Verify Update">
    ```bash theme={null}
    kubectl get pods -n open-webui
    kubectl logs -f deployment/open-webui -n open-webui
    ```
  </Step>
</Steps>

### Rollback if Needed

If the update causes issues:

```bash theme={null}
kubectl rollout undo deployment/open-webui -n open-webui
```

### GitOps (ArgoCD/Flux)

If using GitOps:

1. Update the image tag in your Git repository
2. Commit and push changes
3. ArgoCD/Flux will automatically sync the changes

```yaml theme={null}
spec:
  template:
    spec:
      containers:
      - name: open-webui
        image: ghcr.io/open-webui/open-webui:v0.2.0  # Update this
```

## Python pip Updates

### Update to Latest Version

```bash theme={null}
pip install --upgrade open-webui
```

### Update with All Dependencies

```bash theme={null}
pip install --upgrade --force-reinstall open-webui
```

### Update to Specific Version

```bash theme={null}
pip install open-webui==0.2.0
```

### Check Current Version

```bash theme={null}
pip show open-webui
```

## Version-Specific Updates

### Updating from Ollama WebUI

If you're updating from the old Ollama WebUI:

<Steps>
  <Step title="Backup Data">
    The database will be automatically migrated from `ollama.db` to `webui.db`.

    ```bash theme={null}
    # Backup just in case
    cp /app/backend/data/ollama.db /app/backend/data/ollama.db.backup
    ```
  </Step>

  <Step title="Update Container">
    Follow the standard Docker update process. The migration happens automatically on first run.
  </Step>
</Steps>

### Major Version Updates

For major version updates, check the [changelog](https://github.com/open-webui/open-webui/blob/main/CHANGELOG.md) for:

* Breaking changes
* New required environment variables
* Database migrations
* Configuration changes

## Checking for Updates

### Current Version

Check your current version:

<CodeGroup>
  ```bash Docker theme={null}
  docker exec open-webui cat /app/package.json | grep version
  ```

  ```bash Python theme={null}
  pip show open-webui | grep Version
  ```

  ```bash Web UI theme={null}
  # Check the footer or About page in the Web UI
  ```
</CodeGroup>

### Latest Available Version

```bash theme={null}
# Check GitHub releases
curl -s https://api.github.com/repos/open-webui/open-webui/releases/latest | grep tag_name

# Check Docker Hub
curl -s https://api.github.com/repos/open-webui/open-webui/releases/latest | jq -r '.tag_name'
```

### Version Update Check

Open WebUI can automatically check for updates if enabled:

```bash theme={null}
ENABLE_VERSION_UPDATE_CHECK=true
```

## Update Frequency Recommendations

* **Production**: Update monthly or when security patches are released
* **Development**: Update weekly to get latest features
* **Critical Security Updates**: Apply immediately

## Database Migrations

Open WebUI automatically runs database migrations on startup when `ENABLE_DB_MIGRATIONS=true` (default).

### Manual Migration Control

To disable automatic migrations:

```bash theme={null}
ENABLE_DB_MIGRATIONS=false
```

### Verify Migration Status

Check logs after update:

```bash theme={null}
# Docker
docker logs open-webui | grep migration

# Kubernetes
kubectl logs deployment/open-webui -n open-webui | grep migration
```

## Troubleshooting Updates

### Update Fails to Start

1. Check logs for errors:

```bash theme={null}
docker logs open-webui
```

2. Verify environment variables are still set correctly
3. Check for breaking changes in release notes

### Database Migration Errors

If migration fails:

1. Restore from backup
2. Check [GitHub Issues](https://github.com/open-webui/open-webui/issues)
3. Try disabling migrations temporarily:

```bash theme={null}
ENABLE_DB_MIGRATIONS=false
```

### Configuration Issues

If configuration seems lost:

1. Verify volume is mounted correctly:

```bash theme={null}
docker inspect open-webui | grep Mounts -A 10
```

2. Check data directory permissions:

```bash theme={null}
docker exec open-webui ls -la /app/backend/data
```

### Rolling Back

#### Docker Rollback

```bash theme={null}
# Stop current version
docker stop open-webui
docker rm open-webui

# Pull specific older version
docker pull ghcr.io/open-webui/open-webui:v0.1.123

# Start with older version
docker run -d -p 3000:8080 \
  -v open-webui:/app/backend/data \
  --name open-webui \
  ghcr.io/open-webui/open-webui:v0.1.123
```

#### pip Rollback

```bash theme={null}
pip install open-webui==0.1.123
```

## Update Notifications

### Subscribe to Updates

* Watch the [GitHub repository](https://github.com/open-webui/open-webui)
* Join the [Discord community](https://discord.gg/5rJgQTnV4s)
* Follow release RSS feed

### GitHub Watch

1. Go to [https://github.com/open-webui/open-webui](https://github.com/open-webui/open-webui)
2. Click "Watch" → "Custom" → "Releases"
3. Get notified of new releases

## Best Practices

<Steps>
  <Step title="Test in Staging">
    Test updates in a staging environment before applying to production.
  </Step>

  <Step title="Backup First">
    Always backup your data before updating.
  </Step>

  <Step title="Read Release Notes">
    Check the changelog for breaking changes and new features.
  </Step>

  <Step title="Plan Downtime">
    Schedule updates during low-usage periods.
  </Step>

  <Step title="Monitor After Update">
    Watch logs and user feedback after updating.
  </Step>
</Steps>

## Automated Update Pipeline

For production deployments, consider this workflow:

```yaml .github/workflows/update-open-webui.yml theme={null}
name: Update Open WebUI

on:
  schedule:
    - cron: '0 2 * * 0'  # Weekly on Sunday at 2 AM
  workflow_dispatch:  # Manual trigger

jobs:
  update:
    runs-on: ubuntu-latest
    steps:
      - name: Backup Data
        run: |
          # Your backup script
          
      - name: Update Docker Container
        run: |
          docker pull ghcr.io/open-webui/open-webui:main
          docker stop open-webui
          docker rm open-webui
          # Restart with new image
          
      - name: Verify Health
        run: |
          sleep 30
          curl -f http://localhost:8080/health || exit 1
          
      - name: Notify on Failure
        if: failure()
        run: |
          # Send notification (email, Slack, etc.)
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Docker Deployment" icon="docker" href="/deployment/docker">
    Docker deployment guide
  </Card>

  <Card title="Kubernetes" icon="dharmachakra" href="/deployment/kubernetes">
    Kubernetes deployment
  </Card>

  <Card title="Environment Variables" icon="gear" href="/deployment/environment-variables">
    Configuration reference
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/troubleshooting">
    Common issues and solutions
  </Card>
</CardGroup>
