Revision of Installing Trisquel on a server from Sat, 08/08/2009 - 16:59

The revisions let you track differences between multiple versions of a post.

The 2.x robur LTS version of Trisquel is a very good choice for a server: it has a 64 bit edition -needed for 4GB+ RAM, and recommended for virtualization-, a server optimized linux-libre kernel, and a Xen linux-libre kernel as well.

We are working in a netinst image, wich will allow you to install a server using a small and handy iso image with a full featured installer which downloads the needed packages from the desired Trisquel mirror. In the meantime, you can use this howto to manually install a clean server environment.

You will need...

  • A Trisquel 2.x CD. Any cd should work, we recommend you to use a i386 image to build a 32 bit server and a amd64 to build a 64 bit one.
  • A server with compatible hardware. You can use almost any x86/x86_64 server, but take not to buy parts with no free drivers, as they will not work.
  • Some skills about managing a Debian based server. If you are a newbie, install the edu edition with the included installer and use it as a server -with the desktop environment-.

Starting

Start a Live CD session in your server. Open a terminal and run "sudo su". All the commands listed below will be run here. You will need to update the Live CD apt lists and install some packages:

aptitude update
aptitude install debootstrap gparted

Partition and format your disk

You can partition a disk in a lot of ways and using different hardware configuration. For the purposes of this howto, we will assume that you are installing Trisquel in a single and empty SATA/SCSI disk with no RAID.

NOTE: We will refer to the disk as /dev/sda

Start the partition manager Gparted (Trisquel > System > Administrator > Gparted ). You can partition your disk using the layout of your choice, but we recommend this one:

DEVICE     MOUNTPOINT   FILESYSTEM    SIZE
/dev/sda1  swap         swap          1.5 times the memory size
/dev/sda2  /            ext3          5GB
/dev/sda3  /tmp         XFS           1GB
/dev/sda4  /home        XFS           the rest of the disk
Notes:
  • The swap is optional, it will be needed if you want to have suspend-to-disk support.
  • Never use XFS for the partition containing /boot
  • Having /tmp in a partition will keep the server from crashing by fullness.

So, use Gparted to break the disk into that pieces, and save. Now to format the partitions, use this commands:

mkswap /dev/sda1
mkfs.ext3 /dev/sda2
mkfs.xfs /dev/sda3
mkfs.xfs /dev/sda4
This is just a example layout, you can use the one that fits your needs.

Mount the disk

Create a mountpoint:
mkdir /target
Now mount the root (/) partition into /target
mount /dev/sda2 /target

Install the base system

You will use debootstrap to download and install a trisquel base environment.

debootstrap trisquel /target
Some usefull parameters you can give to debootstrap are the arch (it will use the same as the Live CD if you don't give it one), and the mirror (it defaults to archive.trisquel.info, located in Spain):
debootstrap --arch=amd64 trisquel /target http://us.archive.trisquel.info

Configure the base system

You will like to configure your installation, and the first step is to fill the /target/etc/apt/sources.list file. You can just copy the file from the Live CD or use this contents:

# Trisquel repositories for supported software and updates
deb http://archive.trisquel.info/trisquel robur main extras
deb-src http://archive.trisquel.info/trisquel robur main extras
deb http://archive.trisquel.info/trisquel robur-updates main extras
deb-src http://archive.trisquel.info/trisquel robur-updates main extras
deb http://archive.trisquel.info/trisquel robur-security main extras
deb-src http://archive.trisquel.info/trisquel robur-security main extras
The backports repo is not recommended in a server. You can replace archive.trisquel.info with the mirror of your choice.

Now enter in the chroot:

chroot /target
You should now be able to update your apt lists and install packages. This is a list of recommended commented commands to run:
# set the root password
passwd

# mount /proc
mout none /proc -t proc

# set up your dns config, replace the ip with your dns server.
echo "nameserver 192.168.1.1" > /etc/resolv.conf

# update the apt lists
aptitude update

# install a linux-libre kernel image and boot loader package
aptitude install linux-image-server grub

# install the boot loader in the MBR
grub-install /dev/sda

# umount /proc
umount /proc

# exit the chroot
exit

Edit the fstab

You need to edit the /target/etc/fstab file according to the disk layout you made. This is the fstab file that matches our suggested selections:

#<file system> <mount point>   0    1       2  3
 proc          /proc           proc      defaults        0       0
 none          swap            sw        defaults        0       0
 /dev/sda2     /               ext3      relatime        0       1
 /dev/sda3     /tmp            xfs       relatime        0       2
 /dev/sda4     /home           xfs       relatime        0       2
You can now reboot and login into your new Trisquel server!

What to do next?

Your new server is an empty shell. You will need to install whatever you need in your box. Here are some handy suggestions:

Install a Xen environment

This is an easy one, you just need to add a package:
aptitude install trisquel-server-xen

Build a GLAMP server

To serve web pages, the most common web server is apache. If you don't need php or a database, just type this:

aptitude install apache2
To get a complete GLAMP (GNU/Linux Apache MySQL PHP) server, use this:
aptitude install apache2 mysql-server phpmyadmin
That will install all the needed dependencies, and will also allow you to manage your database by login into http://localhost/phpmyadmin

Revisions

08/08/2009 - 16:59
Trisquel
06/02/2010 - 03:30
AndrewT
08/16/2013 - 20:46
lloydsmart
11/23/2014 - 16:37
levlaz
06/20/2017 - 14:29
acabey
05/13/2024 - 17:31
Luck-02
09/22/2024 - 09:12
knife