Configuring .env file remotely on your VPS

Elif Nur Türk
Aug 22, 2024

The .env file typically holds sensitive information such as API keys, database credentials, and configuration settings. This file should be created and managed securely to ensure your application's proper operation.

Access your VPS and navigate to the directory

cd /path/to/your/directory

Let’s create an .env file in directory.

vi .env

This command will generate a .env file in your specified directory.
To edit the file, simply execute the command "i".

i

Afterward, you can paste your environment variables directly into the file.

To save and exit, press Esc and then run the appropriate command.

:wq

Now its saved. You can then rebuild your application and restart the VPS server to apply the changes.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Elif Nur Türk
Elif Nur Türk

No responses yet

What are your thoughts?