Knowledgebase

How to Set Environment Variables Permanently on Linux Print

  • 0

Configure API keys, PATH entries, or app settings globally or per user.

Step-by-Step Instructions

  1. Add export VAR=value to ~/.bashrc for user sessions.
  2. Use /etc/environment for system-wide variables.
  3. Reload your shell with source ~/.bashrc.
echo 'export NODE_ENV=production' >> ~/.bashrc
source ~/.bashrc

Pro Tip: For web apps, prefer project-level .env files with chmod 600 permissions.

Need assistance? Open a ticket in the A1 Client Area or contact our 24/7 NOC Engineering Team on WhatsApp at +1 (406) 229-9597.


Was this answer helpful?

« Back