# Unable to access CakePHP development server from browser

**URL:** <https://discourse.cakephp.org/t/unable-to-access-cakephp-development-server-from-browser/11234>\
**Category:** Need Help\
**Tags:** help\
**Created:** [May 21, 2023, 4:54am UTC](https://discourse.cakephp.org/t/unable-to-access-cakephp-development-server-from-browser/11234 "2023-05-21T04:54:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lamine](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@Lamine](https://discourse.cakephp.org/u/Lamine)\
**Post date:** [May 21, 2023, 4:54am UTC](https://discourse.cakephp.org/t/unable-to-access-cakephp-development-server-from-browser/11234/1 "2023-05-21T04:54:40Z")

</div>

Hello there, I installed PHP & MariaDB via docker.  
So when I run ‘bin/cake server’ command it tells ‘built-in server is running in [http://localhost:8765/’](http://localhost:8765/%E2%80%99).  
But when I type this URL, the browser shows:  
‘can’t reach this page  
localhost refused to connect’.  
Do I still need a real web server for this to work?

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [May 21, 2023, 8:02am UTC](https://discourse.cakephp.org/t/unable-to-access-cakephp-development-server-from-browser/11234/2 "2023-05-21T08:02:12Z")

</div>

This could be due to e.g. a firewall blocking HTTP requests to localhost  
But as you can see in my [tutorial series](https://www.youtube.com/watch?v=RLdsCL4RDf8&list=PLsrmQF03GOwDfekGkrVuc4XF_RY7V6o5G) this should work fine without a problem.

---

<div class="post-metadata">

**Author:** ![Lamine](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@Lamine](https://discourse.cakephp.org/u/Lamine)\
**Post date:** [May 21, 2023, 10:52am UTC](https://discourse.cakephp.org/t/unable-to-access-cakephp-development-server-from-browser/11234/3 "2023-05-21T10:52:54Z")

</div>

I tried turning off the Windows firewall but it still not working.

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [May 21, 2023, 3:39pm UTC](https://discourse.cakephp.org/t/unable-to-access-cakephp-development-server-from-browser/11234/4 "2023-05-21T15:39:49Z")

</div>

How did you install PHP and execute composer?  
Its been a long time since I tried that on Windows but I remember it being rather straight forward with [XAMPP](https://www.apachefriends.org/) which has its own Apache webserver and MariaDB

Also see [Installation - 4.x](https://book.cakephp.org/4/en/installation.html) on how to correctly set the docroot (which should be the `webroot` folder)

Then you don’t need to run the `bin/cake server` command since you are running a proper webserver.

---

<div class="post-metadata">

**Author:** ![Lamine](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@Lamine](https://discourse.cakephp.org/u/Lamine)\
**Post date:** [May 21, 2023, 4:49pm UTC](https://discourse.cakephp.org/t/unable-to-access-cakephp-development-server-from-browser/11234/5 "2023-05-21T16:49:01Z")

</div>

I’m wondering if it has something to do with the specific PHP tag being installed(from, cli, etc). I used Dockerfile to install php:8.2.0-fpm, and composer, then used composer to install CakePHP. It was working in combination of PHP+nginx, I just decided to test PHP development server.  
Document root is pointed to webroot as well👇

 ![Screenshot (31)](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/b/beb97865e2c88418ddb576160f091dd47fea88ff.png)

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [May 21, 2023, 5:48pm UTC](https://discourse.cakephp.org/t/unable-to-access-cakephp-development-server-from-browser/11234/6 "2023-05-21T17:48:24Z")

</div>

you are inside docker, not windows. Therefore `localhost` isn’t Windows but the container.

I’d recommend you get a bit more acostumed to Docker because your problem is associated to your docker setup, not CakePHP

---

<div class="post-metadata">

**Author:** ![ishan](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/ishan/32/2589_2.png) [@ishan](https://discourse.cakephp.org/u/ishan)\
**Post date:** [May 22, 2023, 12:58pm UTC](https://discourse.cakephp.org/t/unable-to-access-cakephp-development-server-from-browser/11234/7 "2023-05-22T12:58:34Z")

</div>

As @KevinPfeifer mentioned, the issue is with your docker setup not CakePHP. The server is running on port 8765 inside the container, not host machine. You have to map the port using `-p 8765:8765` option when you start the docker container.
