# Laravel Passport: LogicException: Key path "file:///var/www/storage/oauth-private.key" does not exist or is not readable

**Code:** `Key path oauth-private.key does not exist or is not readable` · **Category:** Laravel · **Seen on:** Laravel, PHP

Passport can't find or read its OAuth signing keys.

## Meaning

Generate keys with `php artisan passport:keys` (or `passport:install`), ensure they're in `storage/` (not git-committed) and readable by the web user with correct permissions (600/660). On deploy, keys must be present or supplied via `PASSPORT_PRIVATE_KEY`/`PASSPORT_PUBLIC_KEY` env vars.

## Common causes

- `passport:keys` never run on this server
- Keys not copied by the deploy
- Permissions/ownership wrong
- Keys wiped by clean deploy
- Env var contains wrong line breaks

## Quick fix

1. `php artisan passport:keys`
2. Check `ls -l storage/oauth-*.key` and chown to the web user
3. Provide keys through env variables in container deployments

## Detailed fix by platform

### Laravel

1. `php artisan passport:keys --force && sudo chown www-data storage/oauth-*.key`

## How to diagnose

1. **Files** — oauth-private/public.key exist?
2. **Perms** — Readable by web user?
3. **Deploy** — Preserved?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/laravel/passport-oauth-keys-do-not-exist)
