How to Install Dropbox on a Headless Ubuntu Server 16.04/17.10

This tutorial will show you how to install Dropbox on a headless Ubuntu server 16.04/17.10 to backup and sync files and also how to enable Dropbox to auto-start at boot time.

Install Dropbox on Ubuntu Server

First, SSH into your Ubuntu Server. Then download Dropbox using the following command. It will be saved as dropbox-linux.tar.gz.

64 bit

wget https://www.dropbox.com/download?plat=lnx.x86_64 -O dropbox-linux.tar.gz

32 bit

wget https://www.dropbox.com/download?plat=lnx.x86 -O dropbox-linux.tar.gz

Create a directory in /opt and extract Dropbox to /opt/dropbox/.

sudo mkdir /opt/dropbox/

sudo tar xvf dropbox-linux.tar.gz --strip 1 -C /opt/dropbox

Now you can run the Dropbox daemon.

/opt/dropbox/dropboxd

It will ask you to visit a web address in order to link your Ubuntu server with your Dropbox account.

dropbox ubuntu server

Once the link is complete, return to the terminal window and press Ctrl+C to temporarily stop Dropbox daemon because it by default runs in the foreground and you can’t run other commands. The Dropbox sync folder appears in your home directory.

How to Enable Auto-Start

To make Dropbox start at system boot time, we can create a systemd service unit.

sudo nano /etc/systemd/system/dropbox.service

Put the following lines into the file. We want Dropbox to run as a standard user instead of root, so replace username with your real username. If it runs as root user, then files in ~/Dropbox will not sync properly.

[Unit]
Description=Dropbox Daemon
After=network.target

[Service]
Type=simple
User=username
ExecStart=/opt/dropbox/dropboxd
ExecStop=/bin/kill -HUP $MAINPID
Restart=always

[Install]
WantedBy=multi-user.target

Save and close the file. Then we can start this service by running:

sudo systemctl start dropbox

And enable auto-start at system boot time.

sudo systemctl enable dropbox

Check its status.

systemctl status dropbox

dropbox ubuntu headless

You can stop it with:

sudo systemctl stop dropbox

Restart it with:

sudo systemctl restart dropbox

Now you can restart your Ubuntu server and check if auto-start is working.

sudo shutdown -r now

That’s it! I hope this tutorial helped you install Dropbox on a headless Ubuntu server. As always, if you found this post useful, then subscribe to our free newsletter.

Rate this tutorial
[Total: 4 Average: 3.8]