Magento Droplet preconfigured with Sample-Data

Posted July 22, 2015 11.9k views
UbuntuDigitalOcean 1-Click Apps MarketplaceApplications

Dear DigitalOcean Team,

we would like to have a magento installation with preconfigured sample data (, as it is provided by magento. Do you have such one click application droplets available or would it be made available in the future?

If not, what would be the best procedure from your perspective to reach that goal?

Many thanks and regards,


btw, there is no tag “Magento” available below.


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

Hi! When you create a droplet, you can select the one click Magento image. Take a look at How To Use the Magento One-Click Install Image for more info on how to use it.

To install the sample data, log in to your droplet as root and download the sample data archive:

mkdir ~/magento_sample_data
cd ~/magento_sample_data

Then, extract it and copy the files to the magento instance:

tar xjvf magento-sample-data-
cd magento-sample-data-
cp -r media/* /var/www/html/magento/media/
cp -r skin/* /var/www/html/magento/skin/

Finally, you’ll need to import the mysql dump that’s provided with the sample data. However, you will first need to delete the existing database as the sample data cannot be installed on an existing setup.

mysql -Bse 'drop database magento;'
mysql -Bse 'create database magento;'
mysql magento < magento_sample_data_for_1.9.0.0.sql

To clean up, simply delete the magentosampledata directory:

rm -r ~/magento_sample_data

You can now browse to your droplet’s IP address to access the demo magento store.

  • Thanks a lot! Worked like a charm!

  • Dumping the db will cause the admin-user to be deleted as well. The sample data does not have a admin user, therefore, you’ll need to create a new admin-user. I did it by executing following scripts:

    INSERT INTO admin_user 
    NULL user_id,
    "Admin" firstname,
    "Super" lastname,
    "" email,
    "admin" username,
    MD5('lalilu') password,
    NOW( ) created,
    NULL modified,
    NULL logdate,
    0 lognum,
    0 reload_acl_flag,
    1 is_active,
    (SELECT MAX(extra) FROM admin_user WHERE extra IS NOT NULL) extra,
    NULL rp_token,
    NOW() rp_token_created_at,
    0 failures_num,
    NULL first_failure,
    NULL lock_expires;
    INSERT into admin_role
    NULL role_id,
    (SELECT role_id FROM admin_role WHERE role_name = 'Administrators') parent_id,
    2 tree_level,
    0 sort_order,
    'U' role_type,
    (SELECT user_id FROM admin_user WHERE username = 'admin') user_id,
    'admin' role_name,
    NULL gws_is_all,
    NULL gws_websites,
    NULL gws_store_groups;

Setting File and Directory Ownership and Privileges

cd /var/www/html/magento
chown -R www-data .
find . -type d -exec chmod 700 {} \;
find . -type f -exec chmod 600 {} \;