No application encryption key has been specified.
Laravel needs APP_KEY. Make one on your computer, add it to your app's variables on Tanzahost, and redeploy. Never commit it to Git.
Updated 17 Oct 20261 min read
The fix on Tanzahost: add an APP_KEY variable to your app, then redeploy.
On your computer, in your Laravel project, make a key and print it, without changing any file:
php artisan key:generate --showCopy the whole value it prints,
base64:included.Open your project's Variables tab, choose your app, and add
APP_KEYwith that value.Choose Redeploy. The new version starts with the key, and visitors switch to it without downtime.
Keep the same key from then on. Laravel encrypts sessions, cookies and anything your code encrypts with it, so a new key logs everyone out and can't read what the old one encrypted.
Why it happens
Laravel reads APP_KEY from its environment. On your computer it's in .env, and .env rightly stays out of Git, so the code we build has no key. On Tanzahost an app's settings and secrets are its variables: stored encrypted, shown masked, and given to every process of the app when it starts, workers and scheduled tasks included.
Running php artisan key:generate in the app's terminal doesn't help: it writes to a .env file, and your app's code is read-only while it runs. A variable is the only place it belongs.
How to check
On the Variables tab, look for
APP_KEY. If the page says "Redeploy to apply", the live version doesn't have it yet.Open the app's terminal and check that the app sees a key (this prints only its length, not the key):
printenv APP_KEY | wc -cA Laravel key starting with base64: is about 52 characters. If you moved from another host, use that host's APP_KEY instead of a new one, so your visitors stay logged in and encrypted data still opens.