# Creating a local pkg repository



## balanga (Dec 9, 2022)

For a long time I have been interested in setting up my own local pkg repository but haven't really set about doing so.... How much space would it take up and how often would I need to update it, and is there a guide on setting up such a thing?


----------



## Alain De Vos (Dec 10, 2022)

Here is how i do.
-I created a jail.
-Within this jail i do the ports building
-I use poudriere for building.
-I jail-zfs so poudriere can make use of zfs-features.
-To serve the build packages i use nginx within this jail.
This setup works fine.
As space requirement at least 30G , 300G is better.

A link,





						How To Set Up a Poudriere Build System to Create Packages for your FreeBSD Servers  | DigitalOcean
					

FreeBSD’s ports system is one of its greatest assets for users who want flexibility and control over their software. It allows users to easily create and mai…




					www.digitalocean.com


----------



## zirias@ (Dec 10, 2022)

Although you can do it manually (pkg-repo(8)), I really recommend using ports-mgmt/poudriere (or ports-mgmt/poudriere-devel for now if you want to mix in official packages) which automates building in clean environments and repository creation.
How much space your repository needs depends on the number and size of packages you want to have included, obviously. With the 210 ports I have currently listed, resulting (through dependencies) in 1958 packages, I currently get a repository of 7.4 GiB.
How often you "need" to update is up to you. How often do you want to update the machines using your repo? Are there security updates relevant for your ports, and how critical are they? How much time / computing power / energy does your bulk build consume? Find something that's a good balance for you. I normally do a bulk build every 1-2 months, but sometimes more often if I need to test something for ports development or need some security update quickly...


----------



## Alain De Vos (Dec 10, 2022)

Update every month seams reasonable to me.


----------

