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

crysg's avatar
Level 1

Fresh install of laravel 11 with Dockerfile locally does not show laravel page

I'm mostly following a guide to dockerize and locally run a fresh install of the Laravel app but when I try localhost:8080 I get ERR_EMPTY_RESPONSE

I got a fresh Laravel install from: composer create-project --prefer-dist laravel/laravel my-laravel-app-1

where running $ php artisan --version returns Laravel Framework 11.35.1 My Dockerfile

And for the docker commands I ran

docker build -t my-laravel-app-1 .
docker run --init -d -e PORT=8080 -p 8080:8080 my-laravel-app-1

So when I run docker container ls I get

CONTAINER ID   IMAGE              COMMAND                  CREATED         STATUS         PORTS                            NAMES
d601e608d71a   my-laravel-app-1   "docker-php-entrypoi…"   9 minutes ago   Up 9 minutes   80/tcp, 0.0.0.0:8080->8080/tcp   confident_ptolemy

Which looks right to me but I keep getting empty responses at localhost:8080.

Is that expected for a fresh Laravel install? I was expecting the Laravel page.

Any help would be greatly appreciated!

0 likes
1 reply
s4muel's avatar

it seems the apache is not listening on the port you want (8080), it defaults to 80 and in the config you are not changing it (forgive me if incorrect, not a docker pro😅). i see you set the PORT env variable, but couldnt find whether it is really used or not. according to a github discussion, it isn't. this is it and it might help: https://github.com/docker-library/php/issues/1030

Please or to participate in this conversation.