How to edit or add environment variables after deployment

Update or add environment variables for your Node.js application after deployment on Hostinger

Updated 2 days ago

After deploying a Node.js application on Hostinger, you can edit existing environment variables or add new ones at any time. Changes to environment variables require a redeployment to take effect.

You can access environment variable settings from two locations in the control panel:

  • Website Dashboard

  • Deployments section

Option 1 — Edit from the Website Dashboard

  1. Open the Website Dashboard for your Node.js application.

  2. Click Settings & Redeploy.

    Hostinger dashboard with the settings and redeploy gear icon highlighted in the Deployment section

You will be redirected to the redeployment settings page.

Option 2 — Edit from the Deployments section

  1. Open your Website Dashboard.

  2. Navigate to the Deployments section.

  3. Click Settings & Redeploy.

    Hostinger Deployments page with the Settings and redeploy button highlighted

This will also open the redeployment settings page.

How to edit or add environment variables

Once you are in the Settings & Redeploy flow:

  1. Navigate to the Environment variables section.

  2. Edit existing variables or add new ones as needed.

Review all environment variables to ensure values are correct.

Hostinger Deployments page with environment variables section and Save and redeploy button highlighted

Rebuilding applications

After modifying environment variables:

  1. Confirm the changes.

  2. Proceed with rebuilding the application.

The application must be rebuilt for updated environment variables to be applied.

Important note about ZIP-based deployments

The redeployment process differs depending on how your application was originally deployed.

If your application was deployed using a ZIP file, your last uploaded file is automatically saved and pre-selected under Source files → Use previous files on the redeployment settings page.

When updating environment variables only — with no changes to your app’s code or content — you can proceed with the saved file without re-uploading. Select Upload new files only if you also need to deploy updated code at the same time.

When to update environment variables

You may need to update environment variables when:

  • Adding new configuration values
  • Updating database credentials
  • Rotating API keys or secrets
  • Changing environment-specific settings