# Updating Secrets

> Part of the NocoDB documentation (Product docs > Integrations > Data Sources). Index of all pages: https://nocodb.com/llms.txt. Any docs page is available as Markdown by adding `.md` to its URL.

URL: https://nocodb.com/docs/product/integrations/data-sources/updating-secret
Last updated: 2026-10-03

Update secrets in NocoDB with the nc-secret-mgr package, from the CLI or an executable.

## Updating Secrets

To update a secret in NocoDB, use the `nc-secret-mgr` package. Do these steps:

### Using the Command Line Interface (CLI)

1. If the `nc-secret-mgr` package is not installed, install it. Run this command in your terminal:

   ```bash
   npm install -g nc-secret-mgr
   ```

2. To update a secret, run this command:

   ```bash
   NC_DB="pg://host:port?u=user&p=password&d=database" nc-secret-mgr update --prev <previous-secret> --new <new-secret>
   ```

   OR

   ```bash
   NC_DB="pg://host:port?u=user&p=password&d=database" nc-secret-mgr <previous-secret> <new-secret>
   ```

   Replace `<previous-secret>` with the name of the secret that you used before. Replace `<new-secret>` with the new value of the secret.

3. The command updates the secret in NocoDB.

### Using Executables

You can also use the `nc-secret-mgr` executable to update secrets.

1. Download the `nc-secret-mgr` executable from the [NocoDB Github](https://github.com/nocodb/nc-secret-mgr/releases/latest).

2. Run the executable with this command:

   ```bash
   NC_DB="pg://host:port?u=user&p=password&d=database" ./nc-secret-mgr-macos-arm64 update --prev <previous-secret> --new <new-secret>
   ```

   Replace `<previous-secret>` with the name of the secret that you used before. Replace `<new-secret>` with the new value of the secret.

3. The command updates the secret in NocoDB.

Note: All environment variables are supported, including `NC_DB`, `NC_DB_JSON`, `NC_DB_JSON_FILE`, `DATABASE_URL`, and `DATABASE_URL_FILE`. Use any of these variables to specify your database connection. You can also use the equivalent CLI parameters in this table.

| Environment Variable | CLI Parameter         |
| -------------------- | --------------------- |
| `NC_DB`              | `--nc-db`             |
| `NC_DB_JSON`         | `--nc-db-json`        |
| `NC_DB_JSON_FILE`    | `--nc-db-json-file`   |
| `DATABASE_URL`       | `--database-url`      |
| `DATABASE_URL_FILE`  | `--database-url-file` |

---

## Related pages

- [Connect to a Data Source](https://nocodb.com/docs/product/integrations/data-sources/connect-to-data-source.md): Connect an external PostgreSQL or MySQL database to NocoDB as a data source.
- [Sync with Data Source](https://nocodb.com/docs/product/integrations/data-sources/sync-with-data-source.md): Sync changes made in an external data source with NocoDB through Meta Sync.
- [Actions on Data Sources](https://nocodb.com/docs/product/integrations/data-sources/actions-on-data-sources.md): Do actions on data sources in NocoDB: edit, remove, hide, set view visibility and see relations.
