Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

onurzdgn's avatar

Deploy Settings

Hello everyone. I want to ask how can I update my .env file for deploying. Default:

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:pnW0jx71eWrBSyhGGQMisksONCPa4RN8k6c3mxqQVx8=
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=Europe/Istanbul

How I update:

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:pnW0jx71eWrBSyhGGQMisksONCPa4RN8k6c3mxqQVx8=
APP_DEBUG=false
APP_URL=http://mydomain.com
APP_TIMEZONE=Europe/Istanbul

Am I need to change APP_ENV and why? And why am I change to APP_URL?

0 likes
2 replies
Christofer's avatar

Deploy projects without .env file.

That file should be ignored.

What I do is I have .env.staging and another file .env.production

On the remote server I will copy one of those files to .env

Alternatively, just have a single .env.example file without any sensitive information in it. On remote, you can copy that file to .env and edit the contents on the remote server.

To edit a file on your server, you may type: nano .env or if that doesn't work, try vi .env else vim .env

PS: VI and VIM are difficult to use if you don't know how. You'll need to search for instructions on how to switch to edit mode, and back, then how to quit and save.

Nano is the easiest text editor for Linux noobs like me.

Snapey's avatar

Your APP_URL is used in places where laravel cannot determine the domain because it does not have access to the request.

Think of emails that are sent from queued jobs or from console/scheduled commands that need to include a URL back to the site.

Please or to participate in this conversation.