Hosting Apt Repo’s With Freight

If you ever wanted to know how to host your own apt repository on Debian or Ubuntu then this article is for you. We’ve tested multiple solutions and have found that using Freight is by far the easiest way to get a private repository up and running quick. Freight is a modern take on Debian archive management. It is written and maintained by Richard Crowley and is available on GitHub. This article has been copied and slightly modified from Richard Crowley’s GitHub page. First we will want to setup the Freight archive in apt with the commands below.

Note: Richard Crowley’s Freight GitHub repository is no longer being actively maintained, so the instructions are being updated to use the new Freight-Team repository.

Once Freight is installed, we will need to create the /etc/freight.conf file by running the command below. Once you have created the config file, edit the GPG variable with the email address you will use when creating your gpg key, also seen below.

Now we have the base install of Freight complete and all that is left to do is create a gpg key for signing packages in your new apt repository. In order to create your key run the command below.

Note: If your machine complains about not having enough entropy to generate your key, you can refer to Falko Timme’s article on How to Forge for the solution.

Adding Packages to Freight

Next, we will want to add a package to our newly created Freight repository using the commands below. In this example, we are adding a Postfix package that has been compiled with the VDA patch. Note, the package has been copied to the /tmp directory prior to running the commands below.

The last thing we will need to do is setup Nginx to host our newly created repository. This can be accomplished by adding a simple location statement to out main site as seen below. Once this configuration is complete, we will be hosting out repository at InĀ  our follow up article Remove Package From Freight we have detailed how to remove packages from your Freight repository.

Did you find this article useful? Why not share it with your friends?

2 thoughts on “Hosting Apt Repo’s With Freight

Leave a Reply

Your email address will not be published. Required fields are marked *