1. Introduction
This is a step-by-step guide 'for dummies' to installing Tahoe-LAFS on a Debian server entirely from a terminal - for example, through SSH. If you are a more experienced user, and are just looking for a overview at a glance of how you set up Tahoe-LAFS on a Debian server, you may want to take a look at this image instead..
2. Installing dependencies
First of all, you will have to install some dependencies. In a nutshell, these are Python, Twisted, unzip, and some tools for compiling Tahoe-LAFS. Install these dependencies with the following command:
apt-get install python python-dev python-twisted build-essential unzip nano
Don't worry if any of these are already installed. If a specific package gives an error, remove it from the list and try again.
3. Creating a new user
For security reasons, you should run Tahoe-LAFS under its own user. Do the following:
adduser tahoe
We will now switch to this new user and continue from there.
su tahoe
4. Downloading and unpacking Tahoe-LAFS
Important: this guide will assume the current version is 1.8.2. If there is a newer version (check the Tahoe-LAFS website for this) you may need to change the version number in all the commands in this guide.
Now that you are logged in as the tahoe user, we will first go to the home directory for that user.
cd ~
Now we will download the Tahoe-LAFS archive.
wget http://tahoe-lafs.org/source/tahoe-lafs/releases/allmydata-tahoe-1.8.2.zip
... and unpack it.
unzip allmydata-tahoe-1.8.2.zip
5. Compiling Tahoe-LAFS
Now that we have unzipped the Tahoe-LAFS archive, we will go into the folder...
cd allmydata-tahoe-1.8.2
... and issue the actual command to compile Tahoe-LAFS.
python setup.py build
This is going to take a while (possibly a very long while, depending on how fast the machine is), so it is probably a good idea to make a cup of coffee, tea, or beverage of your choice right now, and continue with this guide when compiling has finished.
6. Creating a node
What command you have to run here depends on whether you want to make your machine a storage node or just a client. If it's a server on a high speed connection that's always running, and you have some spare disk space, then it would be a good idea to create a storage node (this means your server will contribute to the storage space on the grid) - however, if you have a DSL or cable line, or your machine is not always running or otherwise unreliable, you should be making a client. This way the grid stays speedy and reliable.
Note: the above guidelines only go for the Cryto storage grid. If you plan on connecting to another storage grid, they may have different guidelines on who should be a storage node or a client.
First of all, go to the directory where the compiled Tahoe-LAFS software now lives.
cd bin
6a. Creating a storage node
Note: for fast and reliable servers only. This will use disk space (configurable later on).
./tahoe create-node
6b. Creating a client
Note: for home DSL or cable connections, unreliable machines, or people who do not wish to contribute storage space.
./tahoe create-client
7. Configuring Tahoe-LAFS
Now it's time to configure Tahoe-LAFS. First go to the Tahoe-LAFS data folder:
cd ~/.tahoe
Now open the configuration file in the nano editor.
nano tahoe.cfg
There are several settings you have to change here.
nickname: This is the nickname your client or node will have. It's not mandatory, but helps to identify your node in the grid. Storage nodes are expected to always have a nickname. Feel free to name your machine whatever you want.
introducer.furl: This is the address of the server that you need to know to connect to the grid. You can get this FURL by asking joepie91 on IRC. Make sure the actual FURL is on the same line as the 'introducer.furl =' line; nano tends to mess this up, and it will break your configuration otherwise.
shares.needed: The amount of 'shares' that is needed to retrieve a file. The recommended setting for the current grid is 4.
shares.happy: The minimum amount of servers the 'shares' have to be spread across in order to consider an upload 'successful'. The recommended setting for the current grid is 5.
shares.total: The total amount of 'shares' that every uploaded file is divided into. The current recommended setting is 8.
7a. Configuring Tahoe-LAFS storage limits
Note: This section only applies to storage nodes.
Tahoe-LAFS uses a somewhat curious method to determine the total storage limit. Rather than setting a maximum amount of space that can be used by Tahoe-LAFS, you 'reserve' space. This works in the following way: when a file is uploaded, your server is asked if it has space to store a part of that file, called a 'share'. If the total free disk space is higher than the reserved space setting, it will be accepted - otherwise it will be rejected. This way Tahoe-LAFS makes sure there is always a specific amount of space available to other applications. This means that, if any files are stored by other applications, this is subtracted from the amount of space Tahoe-LAFS is allowed to use, and NOT from the reserved space.
Set the reserved_space setting to the amount of space you wish to reserve in this manner. Most storage nodes currently have between 1G and 5G reserved space.
8. Starting Tahoe-LAFS
Now, that you are finished configuring Tahoe-LAFS, press Ctrl+O followed by Enter (Return) to save the configuration. Then press Ctrl+X to exit the editor.
Now go back to the directory with the Tahoe-LAFS binary.
cd ~/allmydata-tahoe-1.8.2/bin
Now simply run this command to start Tahoe-LAFS:
./tahoe start
9. Testing if it works
If you are doing this on a local machine: Point your webbrowser at http://localhost:3456/ - if you see the Tahoe-LAFS web interface, it works!
If you are doing this on a remote machine (through SSH): Run this command and see whether it succeeds or gives an error:
curl http://localhost:3456/
If you see a large amount of text appearing on your screen, it worked!
10. Problems?
Ask on IRC!
11. What now?
You may want to use the bash upload script to upload files from your terminal. Other than that you can use url.py to turn read URIs from uploads into gateway URLs. If you want to run a gateway on your server, PM joepie91 on IRC. Other than that, have fun!