How To Fix .env File Not Showing in cPanel

How To Fix .env File Not Showing in cPanel

🔎 Fix: .env File Not Showing in cPanel

The .env file is a simple configuration text file used to define variables for your application’s environment.

👉 But when logging into cPanel → File Manager, you may notice that .env or .htaccess is “missing.”

This happens because cPanel hides dotfiles (files starting with a dot) by default to prevent accidental deletion.


🛠 Fix: Show Hidden Files in cPanel File Manager

Follow these steps to make .env visible:

1️⃣ Login to your cPanel account.
2️⃣ Under Files, click File Manager.
3️⃣ In the top-right corner, click ⚙️ Settings.
4️⃣ ✅ Check the box for “Show Hidden Files (dotfiles)”.
5️⃣ Click Save → Refresh → .env will now appear.


🎨 For x3 cPanel Theme (Older Versions)

If you’re still using the x3 theme:

1️⃣ Scroll to the bottom of cPanel.
2️⃣ Click Reset All Interface Settings.
3️⃣ Open File Manager again.
4️⃣ A popup File Manager Directory Selection will appear.
5️⃣ ✅ Check “Show Hidden Files (dotfiles)” → Click Go.

Now all hidden files (like .env & .htaccess) will be displayed.


⚠️ Security Note

🔒 The .env file contains sensitive credentials (database, API keys, SMTP details, etc.).

  • Never expose it publicly.

  • Always restrict access via .htaccess or server rules.


✅ Conclusion

The .env file not showing in cPanel happens because the “Show Hidden Files” option is disabled in File Manager. By enabling this option, you can easily view and edit .env and other dotfiles.

Share

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0