Finalizing Moodle 4 installation

Hello, I am at the final step of installing Moodle 4.4

but I can’t create the admin password—the box won’t unlock. Does anyone have any idea?

Hi @PascalJ17

Are you installing Moodle using a Bitnami container or something similar? If not, let me know how.

Regards.

I unpacked the archive on my machine and set it up via FTP following the recommendations. After a lot of tinkering, the installation started and is now stuck at the final step. I need it as a municipal councilor of a small rural community to manage relationships among about fifty people of different categories and to preserve the community’s memory heritage using the wiki before our elders disappear.

Hi @PascalJ17

OK, I understand! I think your problem will be permissions. Moodle needs to be able to write to several folders to complete the installation.

  • The first thing you should check is the Moodle data folder (where it stores files and configuration). Make sure the web‑server user www-data has write permissions on that folder.
  • The config.php file in the root of the installation. It must be writable so the installer can modify it.
  • Also verify the Base URL. The URL you enter during installation must match exactly the URL you use to access the site. Check inside config.php for the line that sets $CFG->wwwroot

:spiral_notepad: Note: The recommended permissions are 705 for directories and 604 for files.

There is an option to edit the admin password from the command line, but I don’t think that applies to you.

Let me know, cheers.
Sergio Turpín

Hello Sergio,

Thank you for this quick response.

I had thought about the moodledata issue. The permissions are currently set to 705 for all subfolders of moodledata; otherwise, Moodle has started writing into it. That also means that the URLs in config.php are correct, right?

However, the files:

  • deprecated_capabilities-0d1bd196665633a89976cdb04336e212.cache, for example, has permissions 666
  • moodledata/filedir/0c/51/0c5190a24c3943966541401c883eacaa20ca20cb has permissions 705

Should I revert all files to 604?

Best regards,

Pascal

@sturpin hello,

You mentioned a solution that uses the command line. Although I’ve never done it, I could possibly try it via the terminal?

Hi @PascalJ17

The short answer is NO, you shouldn’t change all files to 604 en masse. It would be a mistake.

The reason you can’t create the administrator password isn’t the permissions on moodledata. That folder is fine. The focus should be on the root folder of the Moodle installation, i.e., where the config.php file and the admin, lib, etc. directories are.

What I’d recommend is… leave moodledata as it is. Don’t touch the permissions on that folder. Check the config.php file in the root of your Moodle installation. Make sure it has write permissions such as 604.

If it still fails after this, you can use a command‑line script to create the admin. Since you already have the installation almost complete, you can run:

php admin/cli/reset_password.php --username=admin --password=YourSecurePassword

This script generates the correct hash and avoids the web‑interface problem.

Let me know how it goes, cheers.
Sergio Turpín

Thanks @sturpin

The permissions are indeed as you described them.

I tried to see where the “Click to enter text” link intended to create the admin password points to, but it points to the page itself. Do you know which file it should have pointed to? If I can fix it in the HTML code of the displayed page, could that solve the problem?

Otherwise, I’ll need to learn how to send a command line to the server using the terminal.

To my surprise, your answer wasn’t automatically translated. Fortunately, other tools are available. :wink:

Hi @PascalJ17

No, I don’t recommend that you touch the page’s HTML code. Even if you find the link, the problem isn’t there, but that Moodle can’t process the form to save the password. Modifying it wouldn’t solve anything and could make things worse :smirking_face:

Since the web route is giving you trouble, the most practical thing is to use the command‑line installer. From the terminal of your server, navigate to the root folder of your Moodle installation and run:

php admin/cli/install.php

This command will start the installation process interactively in the terminal. The big advantage is that it will ask you for the administrator password in plain text and without the web‑form restrictions, so you can create it without any problems.

Haha, yeah, sometimes the translate extension in Discourse doesn’t work as it should :sweat_smile:

Let me know, cheers.
Sergio Turpín

Well. It's not for right away. I work with a graphical interface all the time. Now, I'm learning to use the terminal and thus the shell... and I'm struggling §;-}

If you have access to the command line then Sergio's suggestion is the best one. I would also immediately check that you can add a new user account via the UI and that the form field isn't locked for that either.

As an aside Moodle 4.4 isn't supported any more. The current LTS is Moodle 4.5 (supported to October 2027) and latest version is Moodle 5.2. The required PHP versions may cause you issues depending on your OS. If you have access to the command line, then its much easier to patch and update the code if you install from the git repositories. It saves having to download the new zip file, copy over any custom plugins and config.php file and then swapping all of that with the current live code.

If you need something up and running quickly, Moodle cloud allows for a free trial period. You can create the course and wiki on there and then backup and restore the course to your site once you get it up and running. This will at least allow you to get started with content! They are always on the latest available version of Moodle (5.2) so make sure your server is able to support the requirements of PHP etc.

Kind regards
Derick

Thanks @Derick,

Of course I started by trying to set up version 5.2, assuming it was the “up‑to‑date” version. However, it turned out that the installation was beyond my arch‑geek abilities. I have professionally used version 3.9 in my teaching and back then I managed to create an intranet for a municipal team that wasn’t ready to use it. Two and a half mandates later, the new team seems to be on point. I still need to finish the installation. So I’m getting back to learning the command line and SSH connections.

Afterward... SSH connection impossible. Two different SSH terminals respond:

connection to XXX established

starting-block SSH session

Connection to XXX closed with error timed out

before I had time to do anything.

At that moment, I felt like an idiot.

Hello @PascalJ17

The transfers should be done with the FILEZILLA application in *** SFTP *** mode:
See the paragraph in my guide: E - Installation of the FTP software FILEZILLA

Hello @Gaston,

The transfers with FileZilla were carried out a while ago. Everything seems to be in place, but the very last step [create the admin password] is stuck on an inactive button. I'm currently trying to learn how to use the terminal.

Thank you for taking an interest in my problem.

It seems I'm making progress (slowly). My SSH issues were caused by an incorrect password. After changing it, I was able to log in and navigate to the right location. Once I entered the install launch line you gave me, it responded:

php admin/cli/install.php
The configuration file config.php already exists. Please use admin/cli/install_database.php to upgrade Moodle for this site.

How can I force it to go further without upgrading Moodle?

Hello @Gaston @sturpin @Derick

Thank you for your help in solving my problem. I haven't been able to finish installing Moodle 4.4 and have spent quite a lot of time on it. I am therefore closing the thread as a failure, resetting this disk space and trying the installation from Moodle 4.5 in hopes of more success.

All the best to you.