🚚 How to migrate to Kirby Tips & tutorials
Skip to content

Dropbox sync

It’s possible to connect Kirby with Dropbox but you need your own server. It’s usually not possible on shared hosting, as you need SSH access and the permissions to install software on it.

Disclaimer

Please be aware that you need to know what you are doing in order to install stuff on your server. This tutorial is by no means a beginners guide to server administration and I’m not responsible if anything goes wrong. So follow this at your own risk :).

Install Dropbox on your server

Dropbox offers a very nice client for Linux. Installing it on your server is pretty straight forward. Just follow the instructions on the Dropbox site.

Create a new Dropbox account

Dropbox will ask you to connect your Dropbox account with the client on your server.

It’s highly recommended that you create a new Dropbox account to link with your server. It might sound a bit annoying, but it’s all for the safety of your precious files in your regular Dropbox account. The Dropbox client on your server will have access to all your files on Dropbox and whenever someone hacks your server, they will be able to download all your files – not good!

Connect that new account to Dropbox on your server with the link, which is displayed in the terminal. You will get a brief success message. You can close the installation script and start your Dropbox client. From now on all the files and folders from your new account will be synced with the ~/Dropbox directory on your server. Pretty awesome, right?

Connect Kirby with Dropbox

After installing Kirby on your server, you need to link the content folder with your Dropbox folder. I suggest to do that with a symlink.

Let’s suppose your kirby site is installed in /var/www/mykirbysite.com so your content folder is /var/www/mykirbysite.com/content

To add a symlink to your ~/Dropbox folder do the following:

$ ln -s /var/www/mykirbysite.com/content ~/Dropbox/mykirbysite

If you open the Dropbox web interface now and login with your new account, you can see that the mykirbysite folder contains all the folders and files from the Kirby content folder.

Share your folder

Since you’ve created that second account, to make sure you don’t give access to all files in our Dropbox, you won’t be able to administrate the content folder from your regular Dropbox folder on your computer—that sucks big time and ruins the entire awesomeness of Dropbox. But wait! We can fix that.

Go to the Dropbox web interface and select the mykirbysite folder. Click on the share folder button and enter the email address of your regular Dropbox account.

You will now get a share request email from Dropbox, which you need to accept. Afterwards the mykirbysite folder will also appear in your regular Dropbox and you can edit all files and folders directly form your computer. They will still sync magically with your server and you get a fully functional Dropbox-powered Kirby site.

Make some changes

It’s absolutely awesome to make changes to your local text files and see how your site gets updated online. And the best part: you gain full version control for your website content by Dropbox’s built in versioning.

Author