Increasing the swap file size really solves the «proc_open(): fork failed - Cannot allocate memory» failure Composer issue

You need to increase your server’s swap file size.
Now it is too small:

See details here: How to fix the «proc_open(): fork failed - Cannot allocate memory» failure on a Composer command?

You can stop mysql service in order for first command to work

It is not a quality solution.
The quality solution is to follow the official Composer recommendation.

Swap is installed and already put to 1Gb. Do you think that increasing it to 2Gb will fix the issue?

I think so, because, as the screenshot above shows, only 1/3 (363 Mb) of the swap file are free now.

Try now please.

It has really solved the problem:

I will proceed now to the next installation step.
Do not do anything with the website yet.

Great, thanks!