Skip to content

Adding and Removing Environment Variables

Environment variables are key-value pairs that you define and are used to configure the behaviour of your applications at runtime. Common uses are storing things like API keys, configuration options (staging vs production) and database credentials. They are perfect for anything you don’t want to hardcode into your files or store in version control.

You can use the commands env or printenv to check the environment variables that you have set. If you want to make any changes, it is an easy job to define new variables, and update or delete existing ones.

Adding Environment Variables

  1. From the main Containers screen, open the container you want to manage.
  2. Open the container’s Env Var tab.
  3. Enter the Variable name and Variable contents that you want to add.
  4. New fields will appear for subsequent environment variables. Enter as many as you like.
  5. Click Save Variables.

Your container will automatically restart and the new variables will take effect.

Removing Environment Variables

  1. From the main Containers screen, open the container you want to manage.
  2. Open the container’s Env Var tab.
  3. Hover over the environment variable that you want to remove. A red ‘Delete’ icon will appear.
  4. Click the red delete icon.
  5. Click Save Aliases to confirm the change. Your container will automatically restart and your change will take effect.

You Can’t Delete Protected Environment Variables

There are some predefined environment variables that are required for containers to work properly. You can modify these protected variables, but you can’t delete them.

Whenever an environment variable is protected, the delete icon will be replaced by a link to this article. If you find a protected environment variable that needs to be deleted, please contact support@webslice.com.