E-commerce AWS

Easy Digital Downloads on AWS User Guide

| Product: Easy Digital Downloads on AWS

Overview

This image runs Easy Digital Downloads, the open source, self hosted ecommerce platform for selling digital products. Easy Digital Downloads is a WordPress plugin, so the product is a full WordPress site with the plugin installed and activated: customers browse a storefront, add downloadable products to a cart, check out and receive secure download links, while you manage products, pricing, orders, customers, discounts and reports from the WordPress admin.

The stack is LAMP: WordPress 7.0 with Easy Digital Downloads 3.6.9 on PHP 8.3 under Apache, with a MySQL database. The database data directory, /var/lib/mysql, and the WordPress webroot, /var/www, are each a dedicated, independently resizable EBS data volume, so both the database and the site files are kept off the operating system disk.

The WordPress administrator account is created on the first boot of every deployed instance, and its password, the database password and the database root password are all generated freshly on each instance, so two instances launched from the same Amazon Machine Image never share a credential. The build time database is destroyed before the image is captured, so no default login ships in the image. The credentials are written to /stage/scripts/easy-digital-downloads-credentials.log with mode 0600 so that only the root user can read them.

The site address is derived from the request host on every request, so the storefront answers correctly on the instance public IP, its private IP, or any custom domain you later point at it, with no reconfiguration and no redirect to a stale address.

Prerequisites

Before you deploy this image you need:

  • An Amazon Web Services account where you can launch EC2 instances
  • IAM permissions to launch instances, create security groups, and subscribe to AWS Marketplace products
  • An EC2 key pair in the target Region for SSH access to the instance
  • A VPC and subnet in the target Region, with a security group allowing inbound port 22 from your management network and port 80 for the storefront and WordPress admin
  • The AWS CLI (version 2) installed locally if you plan to deploy from the command line

Step 1: Launch the Instance from the AWS Marketplace

Sign in to the AWS Management Console, open the EC2 service, and select Launch instance. Under Application and OS Images choose AWS Marketplace AMIs and search for Easy Digital Downloads. Select the cloudimg listing and choose Select, then Continue on the subscription summary.

Pick an instance type of m5.large or larger. Choose your EC2 key pair under Key pair (login). Under Network settings select your VPC and subnet, and either create or select a security group that opens port 22 from your management network and port 80 for the storefront and admin. Leave the root volume at the default size or larger; the database and web volumes are attached automatically.

Select Launch instance. First boot initialisation takes a short time after the instance state becomes Running and the status checks pass, while the database is created, WordPress is installed, Easy Digital Downloads is activated and the per instance administrator is provisioned.

Step 2: Launch the Instance from the AWS CLI

The following block launches an instance from the cloudimg Easy Digital Downloads Marketplace AMI into an existing subnet and security group. Replace the AMI ID with the one shown on the Marketplace listing, the key name with your EC2 key pair name, the subnet ID with your subnet ID, and the security group ID with a security group that opens ports 22 and 80 as described above.

aws ec2 run-instances \
  --image-id <ami-id> \
  --instance-type m5.large \
  --key-name <key-name> \
  --subnet-id <subnet-id> \
  --security-group-ids <security-group-id> \
  --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=easy-digital-downloads}]'

When the instance reaches the Running state and its status checks pass, note its public IP address or DNS name from the EC2 console or with aws ec2 describe-instances.

Step 3: Connect to Your Instance

Connect over SSH using your key pair and the login user for your operating system variant.

OS variant SSH login user
Ubuntu 24.04 ubuntu
ssh -i <key-name>.pem ubuntu@<instance-public-ip>

Step 4: Retrieve the Administrator Password

The WordPress administrator password is unique to your instance and was generated on first boot. Read it as root:

sudo cat /stage/scripts/easy-digital-downloads-credentials.log

The file lists the storefront URL, the WordPress admin URL, the administrator login name (cloudimg) and the generated password, along with the database name, database user and generated database passwords. Keep this file somewhere safe.

Step 5: Confirm Easy Digital Downloads Is Running

Over SSH, confirm the web server and the database are active, that the expected ports are listening, and that WordPress and the plugin are the expected versions:

for s in apache2 mysql; do echo "$s: $(systemctl is-active $s)"; done
sudo ss -tln | grep -E ':80|:3306'
sudo -u www-data wp core version --path=/var/www/html/wordpress
sudo -u www-data wp plugin get easy-digital-downloads --field=version --path=/var/www/html/wordpress

You should see both services active, ports 80 and 3306 listening, WordPress version 7.0.2 and Easy Digital Downloads version 3.6.9.

Confirm the storefront, the WordPress login and the store pages answer with HTTP 200:

curl -s -o /dev/null -w 'home:     %{http_code}\n' http://127.0.0.1/
curl -s -o /dev/null -w 'login:    %{http_code}\n' http://127.0.0.1/wp-login.php
curl -s -o /dev/null -w 'products: %{http_code}\n' http://127.0.0.1/products/
curl -s -o /dev/null -w 'checkout: %{http_code}\n' http://127.0.0.1/checkout/

Step 6: Sign In to the WordPress Admin

The storefront and the WordPress admin are served on port 80 by Apache. In a browser, go to the admin sign in page:

http://<instance-public-ip>/wp-admin/

Sign in with the administrator login name cloudimg and the password from the credentials file. From the admin you manage downloadable products, orders, customers, discounts and reports.

The Easy Digital Downloads admin, listing downloadable products with prices and sales

Step 7: Create Your First Digital Product

In the WordPress admin, open Downloads and choose Add Download. Give the product a name and description, set its price, and upload the file customers will receive after purchase under Download Files. Publish it, and it appears in your storefront. Easy Digital Downloads delivers each purchased file through a signed, expiring link, so paid files cannot be shared by URL.

You can configure payment gateways, tax, email receipts and discount codes from Downloads → Settings, and read sales and earnings figures from Downloads → Reports.

Step 8: The Storefront and Checkout

Your customers browse the storefront at the site root and at the Products page, add products to their cart and check out. The storefront is an ordinary WordPress site, so you can style it with any WordPress theme and extend it with the Easy Digital Downloads add on catalogue.

The Easy Digital Downloads storefront, listing digital products with prices and purchase buttons

At checkout the customer reviews their cart of digital products and enters their details to complete the purchase and receive their downloads.

The Easy Digital Downloads checkout, reviewing the cart before purchase

Step 9: The Database and Web Volumes

The MySQL database lives on a dedicated EBS volume mounted at /var/lib/mysql, and the WordPress code and uploaded product files live on a second dedicated EBS volume mounted at /var/www, both kept off the operating system disk and independently resizable. Confirm the layout:

findmnt /var/lib/mysql
findmnt /var/www
df -h /var/lib/mysql /var/www

To grow either tier, resize the EBS volume in the AWS console and then grow the filesystem on the instance; the fstab entries reference the filesystem UUID so the layout persists across reboots and instance replacement.

Step 10: Add a Custom Domain and Enable HTTPS

Because the site derives its address from the request host, you can point a DNS name at the instance and the storefront answers on it immediately, with no WordPress reconfiguration. To serve the site over HTTPS, install a certificate with Certbot for Apache once your domain resolves to the instance:

sudo apt-get update
sudo apt-get install -y certbot python3-certbot-apache
sudo certbot --apache -d your-domain.example

Certbot obtains and installs the certificate and configures Apache to redirect HTTP to HTTPS. Renewals run automatically.

Step 11: Backup and Maintenance

Back up the MySQL database regularly. A logical dump of the WordPress database is the simplest approach and can be scheduled with cron:

sudo mysqldump --single-transaction edd > /var/backups/edd-$(date +%F).sql

Also back up /var/www/html/wordpress/wp-content/uploads, which holds the delivered digital product files. For a full point in time copy, take EBS snapshots of the /var/lib/mysql and /var/www volumes. Keep the operating system patched with sudo apt-get update && sudo apt-get upgrade, and keep WordPress core and the Easy Digital Downloads plugin updated from the WordPress admin.

Support

This image is supported by cloudimg. For help with deployment, product and pricing setup, payment gateways, secure file delivery, discount codes, customer and order management, database tuning, TLS and custom domains, or scaling, contact cloudimg support. Include the instance ID and Region when you raise a ticket.