"Connection was reset" when installing with Docker on localhost

Need help installing Joomla! 3.x? For all Joomla! 3.x installation issues please use this forum.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
joeac
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Sep 25, 2022 5:35 pm

"Connection was reset" when installing with Docker on localhost

Post by joeac » Sun Sep 25, 2022 6:13 pm

Dear kind helpers,

I'm trying to install Joomla! 3.x on my computer inside a Docker container, but when I run Joomla! and try to use my browser (Firefox) to navigate to the installation page on my chosen port on localhost, I get an error page saying "The connection was reset".

In order, I'm running these commands in Windows PowerShell (as an administrator).

1. I navigate to the folder where Joopla! 3.10.11 is installed.

Code: Select all

cd [JOOPLA INSTALL DIR]
2. I create a Docker network so that, when I make a MySQL database, Joopla! will be able to talk to it.

Code: Select all

docker network create joopla-network
3. I create a Docker volume so the MySQL database will have somewhere to live.

Code: Select all

docker volume create joopla-vol
4. I start up the MySQL database in a new Docker container, connect it to the network, and give it the network alias `joomla-mysql`.

Code: Select all

docker run -d `
>> -v joomla-vol:/var/lib/mysql `
>> --network joomla-network --network-alias joomla-mysql `
>> -e MYSQL_ROOT_PASSWORD=secret `
>> -e MYSQL_ROOT_USER=root `
>> -e MYSQL_DATABASE=joomla_db `
>> mysql:5.7
5. Finally, I run Joopla! 3.10 on localhost, port 3000.

Code: Select all

docker run -d `
>> -p 3000:3000 `
>> -v joomla-vol:/var/www/html `
>> --network joomla-network `
>> --hostname localhost `
>> -e JOOMLA_DB_HOST=joomla-mysql `
>> -e JOOMLA_DB_USER=root `
>> -e JOOMLA_DB_PASSWORD=secret `
>> -e JOOMLA_DB_NAME=joomla_db `
>> joomla:3.10
When I then use my browser to navigate to `http://localhost:3000`, instead of seeing the Joomla! installation page, I get the aforementioned error: "The connection was reset" with the subtitle "The connection to the server was reset while the page was loading". I have also tried appending to the URL `/index.php`, `//index.php`, `/installation/index.php` and `//installation/index.php` to the same effect.

The Docker logs give me the following output:

Code: Select all

Ensuring Joomla database is present

MySQL Database Created
========================================================================

This server is now configured to run Joomla!

NOTE: You will need your database server address, database name,
and database user credentials to install Joomla.

========================================================================
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[Sun Sep 25 17:55:57.970622 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/7.4.30 configured -- resuming normal operations
[Sun Sep 25 17:55:57.970712 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
I find the AH00558 warning quite confusing. One suggested solution was to include `--hostname localhost` to my step 5, which I have done, yet the warning remains. It may not be related to the above error. I have also tried navigating with my browser to `http://127.0.0.1`, with and without all the same appendages as before, and with and without the preceding `http://`, and in every case I get the same error, albeit a different one to before: "Unable to connect / A mishap occurred while trying to connect to 127.0.0.1".

I have of course been following all the usual beginner's tutorials with due diligence and have tried to find people with the same issue to no avail. Any help would be greatly appreciated!

johnwood_scra
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Feb 13, 2023 4:11 pm

Re: "Connection was reset" when installing with Docker on localhost

Post by johnwood_scra » Sun Mar 05, 2023 5:42 am

joeac wrote:
Sun Sep 25, 2022 6:13 pm

The Docker logs give me the following output:

Code: Select all

Ensuring Joomla database is present

MySQL Database Created
========================================================================

This server is now configured to run Joomla!

NOTE: You will need your database server address, database name,
and database user credentials to install Joomla.

========================================================================
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[Sun Sep 25 17:55:57.970622 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/7.4.30 configured -- resuming normal operations
[Sun Sep 25 17:55:57.970712 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
I find the AH00558 warning quite confusing. One suggested solution was to include `--hostname localhost` to my step 5, which I have done, yet the warning remains. It may not be related to the above error. I have also tried navigating with my browser to `http://127.0.0.1wordle`, with and without all the same appendages as before, and with and without the preceding `http://`, and in every case I get the same error, albeit a different one to before: "Unable to connect / A mishap occurred while trying to connect to 127.0.0.1".

I have of course been following all the usual beginner's tutorials with due diligence and have tried to find people with the same issue to no avail. Any help would be greatly appreciated!
It seems that the issue might be related to the firewall or antivirus software blocking the connection to localhost. Here are a few things you can try:

Check if the port is open: You can use the following command to check if the port 3000 is open on your system:

Code: Select all

Test-NetConnection -ComputerName localhost -Port 3000
If the port is not open, you may need to add a firewall rule to allow inbound connections to port 3000.

Disable firewall or antivirus software temporarily: Try disabling your firewall or antivirus software temporarily and see if that resolves the issue. If it does, then you may need to add an exception for port 3000 in your firewall or antivirus software.

Try a different browser: It's possible that the issue is specific to Firefox. Try using a different browser, such as Chrome or Edge, to see if that works.

Check the container logs: You can use the following command to check the logs of your Joomla container:

Code: Select all

docker logs <container_name_or_id>
Check if there are any error messages that might indicate the cause of the issue.

Check the Joomla configuration: Make sure that the Joomla configuration is correct. Check if the database host, username, password, and database name are all correct.

Try a different port: If none of the above solutions work, try using a different port, such as 8080 or 8888, and see if that works.

I hope one of these solutions helps you resolve the issue!

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9759
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: "Connection was reset" when installing with Docker on localhost

Post by AMurray » Sun Mar 05, 2023 7:13 am

Is that a typo - you state "Joomla" in your opening sentence then use "Joopla" every other time, too many to simply be a typo. Did you name the folder "joopla" instead of "Joomla".

I may be way off base here, and don't understand the concept of "Docker Containers".
Regards - A Murray
General Support Moderator

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30957
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: "Connection was reset" when installing with Docker on localhost

Post by Per Yngve Berg » Sun Mar 05, 2023 11:40 am

AH00558 : Check out "Creating VHOST in the Apache Documentation.

Sorry, I don't have any experience with Docker either. Maybe you should ask at the Docker Forum.


Locked

Return to “Installation Joomla! 3.x”