Is it possible to entirely sandbox a folder on linux? This is because certain users will be able to upload any files they want to this folder and execute PHP scripts (which in turn can execute more harmful code they upload).

Is it possible to entirely block access of things inside the folder from accessing external resources?

1 Answer 1


I would personally recommend installing a Linux System Container Manager, such as LXD, to set up a Linux Container on your server to isolate the folder from the rest of the system.

Try LXD Online

DigitalOcean has a really great guide on how to set up LXD on Ubuntu 16.04:


This will block users from accessing external resources not in the container.

  • Thanks! Can't exactly remember why I was trying to do this though Apr 7, 2018 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.