I am developing a small LAMP online app, and so far I have been doing all the development online.

I am considering installing Apache/PHP/MySQL on my Ubuntu machine to be able to develop locally as well, but I am wondering if by installing Apache on my machine I would open some security holes, considering it's a web server and that other people would be able to get access to it remotely.

I have important files on my machine, hence my concerns.

1 Answer 1


Generally speaking, the more applications you have on your host, the more likely you are to get exposed. Each application you add, particularly those that listen/accept external requests increases the risk somewhat.

That said, the added risk might be marginal, particularly compared to the productivity boost it might give you. In addition, and perhaps more importantly, if you follow some simple common-sense steps to secure whichever apps you're running, you are mitigating most of the risk. In the LAMP case, it's best to limit the address Apache / MySQL bind to, and force it to listen only on localhost ( This alone drastically reduces the exposure of your PC to external access / threats. There are other steps you might want to take, not only on your PC, but also on the server, to reduce exposure and risk to your server and applications (patch security, install updates, use a firewall, make sure your code itself is secure and many more). In addition, you can take steps to secure your files, so that they are not accessible to the Apache server. Anything from file ownership / permissions, to using encrypted containers that you only mount when e.g. Apache is turned off...

If you still weigh the difference between not having LAMP installed and having LAMP installed securely, I guess the former is still slightly more secure. But the same goes to turning off your PC and putting it in a heavy safe. It will be much more secure, but not particularly usable/useful :)

[UPDATE]: additionally, if you want to create another layer of separation between your LAMP and your own host, perhaps it would be a good idea to run a virtual server inside your Ubuntu desktop. You can use virtualbox or many other virtualisation technologies to create a virtual host and configure it as you wish. You can then control how the network between this virtual host and your desktop are configured more easily, and therefore better protect it and your desktop. This might be a good idea regardless of security, as it would allow you to simulate the server operating system/environment more closely and avoid software conflicts / compatibility issues between your desktop and the LAMP stack.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .