Question

Wordpress image with custom plugin pre installed

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 Appmaker.xyz . So that whoever need to setup an e-commerce website and an App with simple steps


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

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

Hey @saleeh I’d suggest introducing configuration management to achieve this. Try out packer.io . 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: https://www.digitalocean.com/community/tutorials/how-to-install-and-get-started-with-packer-on-an-ubuntu-12-04-vps

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.

standard.yml

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

vars.yml

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

command:
  - 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 :)

This comment has been deleted