I want to install Ubuntu's LAMP stack in VM, but I'm wondering what's the best way going about it

  • Install Ubuntu desktop version followed by installing LAMP using “tasksel.”
  • Same as above, except installing each LAMP component individually.
  • Download and and install the default Ubuntu Server 18.04 LTS, without the desktop environment.
1 Like

To install the LAMP stack in a VM, you can do the following (assuming you are installing to a server version of Ubuntu/Debian Linux):

  1. Open a terminal on your server.
  2. At the server prompt, type: sudo apt-get install lamp-server^
  3. This command will install Apache2, MySQL 5, PHP, and their dependencies, etc.

Note: the above works on Ubuntu server, or any Linux server using APT-GET. You may want to look into upgrading Apache2 to the latest version by searching Google for: PPA for Apache2.x.

This PPA will install the latest version of Apache2, and give you any future updates to Apache2, as they become available.

1 Like

I can think three different ways on top of my head.

The true question here should be what you’d like to accomplish with said install.

Be it a quick eshop demo for a relative? I’d say go with the binary install
Be it to gain experience and know-how on configuring interoperability of said packages for various possible configurations? then apt-get install apache2 mysql php is your answer.

From binary to each package seperately (as in from easy to hard), there are several levels of configurability that can be performed depending on your scenario.
Note that binary and stack installs take care the configuration part from your behalf, allowing you to focus on building things faster.

So the best way to go about it is figure out your end goal and take it from there.
That can be answered only by you.

If I have to install U server then I would do that on Container (using Docker is ok enough).

Take a look at both Vagrant and docker if you want to run lamp in a VM.