How to set up a Seafile Server on a raspberry pi complete

5 Jun

How to set up a Seafile Server on a raspberry pi complete

I set up a dedicated raspberry pi Seafile server with a 2TB external to deal with selective syncing. Mostly with vendor folders like node. I was using Dropbox but I think the amount of syncing and resyncing killed my chromebook’s SSD.

There only a couple major steps to having it up and running to where you should no longer need a keyboard, mouse, or monitor.

1. Install Raspbian on PI

https://www.raspberrypi.org/downloads/

Get the NOOBS.zip setup and extract the contents onto a FAT32 microSD card. Load it up, select en_US (not en_GB) for language at the bottom and install Raspbian.

Once install opened the terminal run these to update the installed packages on the Rasbpian and get the dependencies for Seafile

sudo aptitude update
sudo aptitude -y install python2.7 python-setuptools python-simplejson python-imaging sqlite3

2. Set up static network IP via

sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback


#My IP description
# IPv4 address
iface eth0 inet static
# address of your raspberry pi pick any 192.162.x.xxx. Be consistent
address	192.168.0.100
netmask	255.255.255.0
# address of your router typically
gateway 192.168.1.1
#My IP description 
# IPv4 address
iface wlan0 inet static
# address of your raspberry pi
address	192.168.0.100
netmask	255.255.255.0
# address of your router typically
gateway 192.168.1.1
# some line about a referenced config file should be here to 
# save wireless settings

3. Set up automount external drive

You are going to want to figure out which drive is the correct one you are using. Use sudo fdisk -l to find the name and replace sda1 with your drive below. Replace the filesystem type below with yours. Separate everything with either 1 tab OR 1 space.

sudo fdisk -l
sudo nano /etc/fstab
/dev/sda1 /media/externalHD ntfs defaults 0 1

4. Install Seafile-server for PI

Replace 5.0.3 with the newest version, if any, from

https://github.com/haiwen/seafile-rpi/releases/

wget https://github.com/haiwen/seafile-rpi/releases/seafile-server_stable_5.0.3_pi.tar.gz
tar -xvzf seafile-server_*
mkdir installed
mv seafile-server_*.tar.gz installed
cd seafile-server-*
./setup-seafile.sh

You are going to be asked some questions during the setup.

Set the IP to the one you set in the static IP section or use a no-ip address.

192.168.x.xxx

Set the path of where to hold files on the external.

/media/externalHD/SeaData

5. Configure autostart for seafile onboot via crontab -e

Crontab is a scheduler for commands. We want to start the seafile.sh first and then start seahub.sh after 15 seconds to give time for seafile to boot because seahub depends on seafile running.

crontab -e
@reboot /home/pi/mycloud/seafile-server-latest/seafile.sh start
@reboot sleep 15 && /home/pi/mycloud/seafile-server-latest/seahub.sh start

There you have it.

With a little luck you’ll only have to do this once. Before you disconnect monitor, keyboard, mouse, etc, make sure everything is running and that you can connect after a reboot command in the terminal. Download clients. Connect them to the server using your pi’s ip. http://191.168.x.xxx


A good chuck of this documentation came from this guide. He uses a static external IP address for the pi to be able to connect anywhere to it if you are interested.

http://draptik.github.io/blog/2014/04/21/installing-seafile-on-raspberry-pi/