Wordpress image with custom plugin pre installed

Posted November 25, 2016 3.1k views

Hi all, I am just wondering how to create a custom image that I can share in public with the following things pre-installed.

My use case is that to create an e-commerce site with Woocommerce and an app with .
So that whoever need to setup an e-commerce website and an App with simple steps

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

You can create a snapshot and send it to users who need it. That’s not enough public.

The thing you probably want is User Data - Cloud-Init scripts.
How To Use Cloud-Config For Your Initial Server Setup.
An Introduction to Cloud-Config Scripting.
DigitalOcean User Scripts Library.

For further questions feel free to ask.

by Justin Ellingwood
A cloud-config file is a special script that is used to define configuration details for your server as it is being brought online for the first time. These are often used for completing common tasks that a user would normally have to log into the server to accomplish. In this guide, we will run through how to do some initial configuration of an Ubuntu 14.04 server using a cloud-config file with our metadata service.
  • @xMudrii Thanks for your quick response, I was looking to make it even easier for users. It will be great if users can add custom images. And other can use it easily

    • You can send your idea to DigitalOcean via their UserVoice page.

      I found out that it was already suggested but it didn’t receive positive feedback. Custom One-Click Image is idea you’re looking for.
      But yea, problem stated there is that you can’t know is image malicious or not. You can build up image and ship with virus or some type of backdoor. That’s a big problem and I think it’s better without it.

      Cloud-Init script makes it easy. You see what you execute on your sever, in plain text format and it’s pretty easy to understand it. Also, it’s easy to share it - GitHub, GitHub Gist, whatever you want.

Hey @saleeh I’d suggest introducing configuration management to achieve this. Try out . It’s basically a “tool for creating machine images with pre-configured operating systems and installed software from a single source configuration”. DigitalOcean has a great tutorial on setting it up:

When you get into it, packer has more provisioners other than shell for installing and configuring software. Go through the tutorial first to get what I’m talking about here. For example see how I use this ansible provisioner to install software on the machine:

  "builders": [{
    "type": "digitalocean",
    "api_token": "YOUR API TOKEN",
    "region": "nyc3",
    "size": "512mb",
    "image": "ubuntu-14-04-x64"

  "provisioners": [{
   "type": "ansible",
    "playbook_file": "standard.yml"

It references an ansible playbook: standard.yml which goes through a list of system packages to install that are listed in the vars.yml file.


- hosts: all
    - vars.yml
    - name: Installs required system packages listed in the vars.yml file
      apt: pkg={{ item }} state=installed update_cache=true
      with_items: "{{ system_packages }}"


  - apache2
  - git
  - mysql-server
  - php5-mysql
  - php5
  - libapache2-mod-php5
  - php5-mcrypt
  - unzip
  - zip

  - mysql_install_db
  - mysql_secure_installation

Now all you need to do is share this configuration file that anyone can run to create an image on DigitalOcean with your custom setup. Please share if you do :)

by danny.sipos
In this tutorial we will see how to install and get started with Packer on an Ubuntu 12.04 run VPS.

@xelawafs Thanks for your response. Actually, I am looking even simpler solution. Maybe in future digitalocean will support that