How to create a localhost to develop website locally in EOS

Exactly. As a nice side effect, you’ll learn useful things. :slight_smile:

N.B.: My prediction: The Docker way will be less prone to updating conflicts.

1 Like

Yes, that’s true but it seems installing and using VM on Linux is not as easy as it is in Windows. Everything in Linux has a steep learning curve. :disappointed_face:

Agreed, if you’re new to it. But after 13+ years without Windows I can promise: It pays. And it gets easier every time.

1 Like

I tried installing Docker but it seems more complicated than I thought. I am very new to Linux and newer to EOS a.k.a Arch Linux echosystem, only a few months to be precise. So, many things are much harder to me to understand and to implement successfully than a veteran. But in general, people give advice by assuming that I am well aware of how things work, what commands should I use etc. whereas I am still stumbling on my way. That’s why, in many cases, I request a step-by-step process but that creates a long term process and I become lethargic. But I cannot push people to teach me step-by-step as they also have their own work. So, I again go back to Windows. But after 14th October, I would not have that choice. That’s why I am trying to do it before that day.

Run Windows under a VM. This is the advantage VM has over Docker. My web-server’s are FreeBSD based, which also have the same limitation.

Now all you need to learn is how to use virtual machines. I would argue that VirtualBox is the simplest open-source option, and plenty good enough for running a development web-server.

1 Like

If we’re taking the above GitHub example, it should be as easy as:

  • yay -Syu docker docker-compose
  • cd
  • git clone https://github.com/br0kenpixel/xampp2docker
  • cd xampp2docker
  • (edit docker-compose.yml, put in your timezone, versions, ports, etc.)
  • docker-compose up -d --build (--build only needed 1st time)
  • Browse to localhost:3000 (or whatever port you specified)
  • docker-compose down would shut it down again
  • Your web app goes into ~/xampp2docker/src/.

Above is from memory, without having tried it all. YMMV.

Hint: Within the docker-compose.yml, for folders and ports: The part left of the colon is the “outside”, the part right of the colon is the “inside” of the docker container.

I have used VirtualBox on Windows 10 extensively to try different Linux distros. So, I am familiar with how it works. But, when I was trying Linux distros in VirtualBox, one thing I experienced that there is a significant difference between installing & using Linux in a VM and installing & using Linux in a physical computer. The real hardware components of a physical machine makes a huge difference. So, in my opinion, a VM cannot replicate a physical machine entirely and lacks many key components which affects working of particular software.

1 Like

if you want to use system packages and install specific versions of the software locking them to specific versions your best bet is to 1) install the packages using yay. You can install them all manually or use xamp to get them all at once it makes no real difference. Once you’ve done that 2) use downgrade to downgrade each package to what ever version you want. Downgrade will ask you if you want to put the package in your ignorepkg groupe, answer yes. All done now you can code as you want.

You’re not wrong in that the performance of a VM is reduced as compared to bare metal. This is a given.

However:

  • I was suggesting you run Windows in the VM (not necessarily Linux), as you are already familiar with setting up XAMP on that, and it is now apparent you’re already very familiar with VirtualBox. No guide necesarry.
  • The web exists on hosts in virtualized environments.
  • The percentage of web-servers running under virtualized environments, would be approaching 100%. Even “dedicated” servers, still run inside a virtualized environment. This is what makes it “the cloud”, hosts aren’t tied to physical hardware.
  • Your VM would only be running a development web-server, serving to a single user which would have minuscule resource overhead.
  • A VM running on a modest workstation would far exceed the resources allocated to most cloud hosting plans (with the exception of high-end enterprise / dedicated server plans).

All that said, the choice is of course yours.

1 Like