• Home
  • XAMPP on the cloud (OneDrive, DropBox, Google Drive, Box, ...)

XAMPP on the cloud (OneDrive, DropBox, Google Drive, Box, ...)

If you are like me, I don't like to be bound to a single computer at home, rather I like to have all my files with me all the time, just in case!

If you are a developer and use XAMPP on your local computer, how can you have your XAMPP files on different computers so you can use them at anytime? Follow these steps and you can have all your website files and database with you on any of your computers. 

Step 1- Setup cloud system

In order to take your files with you everywhere, you should have a cloud system on both computer. The most common ones are OneDrive, DropBox, Google Drive, and Box. Most these companies, provide basic cloud system account for free. They also have larger accounts for a fee. The instruction here should work on any of these systems. However, I use OneDrive from Microsoft as my default cloud system.

Step 2- Test cloud system

After you setup your cloud system on both computers, make sure it is working and files are being synced appropriately. If you don't see files syncing correctly, stop here and troubleshoot your setting until it works. The following steps will not work if your cloud account is not setup correctly on both computers. 

Step 3- Install XAMPP 

XAMPP comes in different versions. Make sure to install the same version on both computers. I recommend installing XAMPP in a root directory (C:\XMAPP) instead of a subdirectory (C:\MyWebSite\XAMPP or C:\OneDrive\XAMPP). You don't need to have all XAMPP files saved in the cloud directory.

In this tutorial, I assume you have installed XAMPP in C:\XAMPP and your cloud directory is C:\Users\USERNAME\OneDrive. Make sure to update this based on your setup. Replace USERNAME with your name.

Step 4: Create Base Directories

Now, lets work on Computer#1.
In your cloud directory, create a new directory to hold all your XAMPP files.  I have C:\Users\USERNAME\OneDrive\xampp_files.
Next, go to C:\Users\USERNAME\OneDrive\xampp_files and create a new directory called mysql

Step 5- Copy Directories and files

Now we'll copy only the essential directories and files that contain your website and database files. We will do this on Computer#1 only. 

A- Go to C:\xampp and copy the htdocs directory to  C:\Users\USERNAME\OneDrive\xampp_files.
B- Go to C:\xampp\mysql and copy the data directory to  C:\Users\USERNAME\OneDrive\xampp_files\mysql.

Wait for all the files to be uploaded to the cloud from computer #1. Also, wait for computer #2 to download those files. This may take some time, depending on your internet speed and number of files. Make sure to wait until both computers are in sync, then proceed to step 6. 

Step 6- Setup XAMPP configurations

The following steps should be completed on both computers. 

A- Open C:\xampp\apache\conf\httpd.conf. Find this code on lines 246-247:

DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">

and replace it with: 

DocumentRoot "C:/Users/USERNAME/OneDrive/xampp_files/htdocs"
<Directory "C:/Users/USERNAME/OneDrive/xampp_files/htdocs">

Save the file and close it. 


B- Open C:\xampp\apache\conf\extra\httpd-ssl.conf. Find this code on line 124 

DocumentRoot "C:/xampp/htdocs"

and replace it with:

DocumentRoot "C:/Users/USERNAME/OneDrive/xampp_files/htdocs"

Save the file and close it. 


C- Open C:\xampp\apache\conf\extra\httpd-xampp.conf. Find this code on line 66

<Directory "C:/xampp/htdocs/xampp">

and replace it with:

<Directory "C:/Users/USERNAME/OneDrive/xampp_files/htdocs/xampp">

 Save the file and close it. 


D- Open C:\xampp\mysql\bin\my.ini. Find this code on line 32

datadir = "C:/xampp/mysql/data"

and replace it with:

datadir = "C:/Users/USERNAME/OneDrive/xampp_files/mysql/data"

Then find this code on line 137-139

innodb_data_home_dir = "C:/xampp/mysql/data"
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = "C:/xampp/mysql/data"

and replace it with:

innodb_data_home_dir = "C:/Users/USERNAME/OneDrive/xampp_files/mysql/data"
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = "C:/Users/USERNAME/OneDrive/xampp_files/mysql/data"

Save the file and close it. 


You are done. Now, if XAMPP Apache and MYSQL services are running, stop them both. Then restart on one computer.  

Please keep the following in mind when working with XAMPP after you make the above changes: 
  • Make sure you turn off XAMPP on one computer, wait for the files to sunc completely, then open XAMPP on the second computer. 
  • Do not run XAMPP on two or more computers at the same time. You will get in trouble.
  • When editing the files, make sure not to mix up / with \. Refer to the instruction above to find the right code.


Feel free to share your thoughts and comments below. 

Comments (0)

There are no comments posted here yet

Leave your comments

Posting comment as a guest.
0 Characters
Attachments (0 / 3)
Share Your Location