Packer

Packer is a free, open source application from Hashicorp.

It can generate a server image based on an existing one, and configure it for your special needs. You can use the generated image when you launch a server instance in the cloud or on your local workstation.