Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

How do we set the environment variable permanently in ubuntu based EC2 machine in AWS?

Writer Andrew Mclaughlin

Basically, we want to set the environment variable in the ubuntu based EC2 machine permanently so that the containers or other processes can fetch it.

1 Answer

You can connect to the EC2 instance and edit it in the environment file as mentioned below:-

sudo nano /etc/environment
#Write the name of the environment variable which you want to set in the below format
ENV_NAME="test"
#Close the file by Ctrl+x and execute the below command to reload the variables
source /etc/environment

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy