How to install Fossil version control system in Linux

Fossil is a powerful version control system (VCS) for Linux. It is an alternative to Github, but unlike Git, Fossil works by providing a complete set of tools to create, modify, and even share your repositories online. This article will show you how to install and deploy Fossil on Ubuntu Linux.

Docker and Fossil prerequisites

The first step in deploying Fossil is to get the repository files for Docker. To do that, find the signing key for the Docker project:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

Create a new file in '/etc/apt/sources.list.d' . This will contain the repository link where Ubuntu will fetch Docker packages:

sudo nano /etc/apt/sources.list.d/docker.list

Paste the following code into your new repository file:

deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable

Save your Docker repository file, then install the snap core package:

sudo snap install core

Download the Certbot snap package from the Electronic Frontier Foundation:

sudo snap install certbot --classic

Run the following command to refresh your system package list:

sudo apt update && sudo apt upgrade

Install Docker and Nginx along with their dependency packages:

sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-buildx-plugin nginx

Build and install Fossil in Linux

Navigate to Fossil's download page, then select the source tarball for the latest stable release. The example will download version 2.23 of Fossil.

How to install Fossil version control system in Linux Picture 1

Move the source tarball into your home directory, then extract it:

mv ~/Downloads/fossil-src-2.23.tar.gz
tar xvzf ~/fossil-src-2.23.tar.gz

Go inside the tarball folder, then open Fossil's Dockerfile with your favorite text editor:

cd ~/fossil-src-2.23
nano ./Dockerfile

Scroll to the bottom of the file, then add the following line before the "--user", "admin" ] lines:

"--https", 

How to install Fossil version control system in Linux Picture 2

Save the modified Dockerfile, then build the container image:

sudo docker build -t fossil .

Run Fossil and create an SSL Reverse Proxy

You now have a new instance of Fossil VCS running as a Docker container on your host. To access it, you need to encrypt every external connection to Fossil.

To start, create a new DNS 'A' record pointing to the IP address of the Fossil server.

How to install Fossil version control system in Linux Picture 3

Use your favorite text editor to create a new site configuration file for your Fossil instance:

sudo nano /etc/nginx/sites-available/fossil-scm

Paste the following code block into the new site configuration file:

server {

server_name SUBDOMAIN.YOUR-ROOT.DOMAIN;

location / {
proxy_pass http://127.0.0.1:7777;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}

Replace the server_name variable with the subdomain for Fossil.

How to install Fossil version control system in Linux Picture 4

Create a symbolic link for the site configuration file to '/etc/nginx/sites-enabled/' :

sudo ln -s /etc/nginx/sites-available/fossil-scm /etc/nginx/sites-enabled/

Start the system's Nginx daemon using systemctl:

sudo systemctl enable --now nginx.service
sudo systemctl reload nginx.service

Launch the new Fossil Docker image by running the following command:

sudo docker run 
--publish 7777:8080
--name fossil
--cap-drop AUDIT_WRITE
--cap-drop CHOWN
--cap-drop FSETID
--cap-drop KILL
--cap-drop MKNOD
--cap-drop NET_BIND_SERVICE
--cap-drop NET_RAW
--cap-drop SETFCAP
--cap-drop SETPCAP
fossil

Open a new Tmux panel by pressing Ctrl + B , then C . Inside, run the following command to request an SSL certificate from Certbot:

sudo certbot --nginx -d fossil-scm.myvpsserver.top

Check if your Fossil instance is accessible over the Internet by navigating to the subdomain.

How to install Fossil version control system in Linux Picture 5

Create your first Fossil repository

With Fossil up and running on your Linux server, you can now configure your new instance. Click the setup/config link in the Home section .

How to install Fossil version control system in Linux Picture 6

Provide details about the administrator account, then click sign in. You can find the password for the administrator account in the Docker container's output log.

How to install Fossil version control system in Linux Picture 7

Fill out both the Project Name and Project Description text boxes with your repository details, then click Apply Changes to save it.

How to install Fossil version control system in Linux Picture 8

Clone and use Fossil repository

To use a new code repository, you first need to create a copy of the repository on your machine. To do that, install the local version of Fossil on your Linux desktop:

sudo apt install fossil

Drag the entire repository to your machine and into its repository folder:

fossil clone https://SUBDOMAIN.YOUR-ROOT.DOMAIN
cd ./YOUR-REPO-NAME

Add the initial files, then make changes to the Fossil repository:

nano ./sample.file
fossil add ./sample.file
fossil commit

Provide details about your original commit, then save it by creating a new line starting with a period (.).

How to install Fossil version control system in Linux Picture 9

Push local changes to the remote Fossil repository

By default, Fossil does not provide any write permissions to its remote repository. Any changes you make to the local repository will remain there and not be reflected in the Fossil instance.

To fix this, go to the web interface of your Fossil instance and log in as an administrator.

Click the Admin category on the top menu of the dashboard.

How to install Fossil version control system in Linux Picture 10

Select Users on the admin console.

How to install Fossil version control system in Linux Picture 11

Click Add to create a new user for the repository.

How to install Fossil version control system in Linux Picture 12

Provide a username and password for the new user.

Check the Developer checkbox on the Capabilities category , then click Apply Changes to save the new user.

How to install Fossil version control system in Linux Picture 13

Return to your local terminal, then run the following command:

fossil push https://YOUR-USERNAME@SUBDOMAIN.YOUR-ROOT.DOMAIN

Note : You can also fetch new changes from a remote Fossil repository by running fossil pull.

Enter the password for the Fossil user, then press Enter to push local changes to your remote repository.

Confirm that the remote Fossil repository has received local commits by navigating to its web interface.

How to install Fossil version control system in Linux Picture 14

Installing and implementing your own Fossil version control system is just the first step to taking back control of your data online. Learn how you can secure your online communications by hosting your own email alias server with SimpleLogin.

4 ★ | 2 Vote

May be interested

  • How to install and use AnyDesk on LinuxHow to install and use AnyDesk on Linux
    anydesk, like other remote desktop programs, allows you to access and control remote machines from your local system.
  • How to install Windows Subsystem for Linux 2 on Windows 10How to install Windows Subsystem for Linux 2 on Windows 10
    on windows 10 2004, microsoft is introducing windows subsystem for linux version 2 (wsl 2), which is a new version of the architecture that allows running linux on the original windows 10 and eventually replaces wsl 1.
  • 3 Linux mobile operating systems you can install today3 Linux mobile operating systems you can install today
    are you tired of using android? do not want to become part of the proprietary technology ecosystem? security and privacy are becoming increasingly important for smartphone users, but what are the answers to these problems? for some people, dropping android and switching to a phone that can run a linux mobile operating system is the answer.
  • Install Photoshop on LinuxInstall Photoshop on Linux
    the penguin operating system is not without high-end graphics programs. however, adobe photoshop is deeply ingrained in the graphics world, so don't rush to abandon this operating system and return to windows. in just a few steps, you can use photoshop on linux
  • Control Linux system with fstabControl Linux system with fstab
    in this article, i will show you how to use fstab to control your linux system.
  • 10 things to keep in mind when switching to Linux mobile operating system10 things to keep in mind when switching to Linux mobile operating system
    because it is an important component of the android operating system (os), linux is still very important to the mobile world. however, while android uses the linux kernel, it is just a linux distribution, but linux for mobile devices offers a completely different experience. find out why using a linux mobile phone is a great option, as well as a downside when switching from your favorite mobile operating system to this operating system.
  • How to Install VirtualBox on LinuxHow to Install VirtualBox on Linux
    setting up a virtual machine can be a great way to test alternative software or operating systems on a computer without altering or putting the existing system at risk.
  • How to install XPipe on LinuxHow to install XPipe on Linux
    xpipe is a powerful cross-platform control center for linux servers, docker containers, and virtualization servers. it provides a simple interface to manage multiple systems and server infrastructure on your local machine.
  • How to manage memory to restrict Linux to use too much RAMHow to manage memory to restrict Linux to use too much RAM
    you install linux with the promise that it will consume less system resources than windows. but why then, is your system still slow?
  • Zorin OS 15, a user-friendly version of Linux operating system, for those who are tired of Windows or MacZorin OS 15, a user-friendly version of Linux operating system, for those who are tired of Windows or Mac
    zorin os 15, the operating system version is built on the linux platform but has been customized to suit beginners, focusing on simplicity and ease of use.