{"id":3822,"date":"2017-01-10T09:41:11","date_gmt":"2017-01-10T09:41:11","guid":{"rendered":"https:\/\/www.milesweb.com\/blog\/?p=3822"},"modified":"2026-01-10T15:34:41","modified_gmt":"2026-01-10T10:04:41","slug":"create-debian-repository","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/","title":{"rendered":"How to create your own Debian repository"},"content":{"rendered":"<p>The repositories are invaluable in any Linux system, especially on those servers where we want to have the latest security updates. The most common thing is that\u00a0there is no impediment to using these, but what is normal does not imply that it has to happen always, either due to security policies\u00a0or if the repository is down or that the computer simply does not have access to the\u00a0Internet. The absence of this resource can be fatal in many cases, so it is good to always have a resource that helps us to avoid such obstacle.<\/p>\n<p>A resource that while in domestic is not very practical, but it is perfectly applicable in business environments or in environments where there are servers. It is better to have these repositories stored in a team so that they can be easily accessed by the rest of the\u00a0equipment\u00a0that is within the same network; that is, to have these repositories locally. In this case, we would see a case applied to Debian, but with similar systems such as Ubuntu you should not experience any problems.<\/p>\n<p>The absence of this resource can be fatal in many cases, so it is good to always have a resource that helps us to avoid such obstacle. A resource that while in domestic is not very practical, but it is perfectly applicable in business environments or in environments where there are servers.<\/p>\n<p>It is better to have these repositories stored in a team so that they can be easily accessed by the rest of the\u00a0equipment\u00a0that is within the same network; that is, to have these repositories locally. In this case, we would see a case applied to Debian, but with similar systems such as Ubuntu you should not experience any problems.<\/p>\n<p>With its operation, the only &#8220;catch&#8221; you may have is the fact that you need to have plenty of free space on the hard drive, but removing that detail, can be a really useful solution.<\/p>\n<p>To create this repository, we will need to have two tools installed; one, well known by many, apache2, while the other is much less known, is apt-mirror, so the first thing we will do is, we will be installing the repositories on the system from the official sources.<\/p>\n<p><span style=\"color: #9c059c;\"><em>apt-get install<\/em><\/span> apache2 <span style=\"color: #9c059c;\"><em>apt-mirror<\/em><\/span><\/p>\n<p>Installation is automatic, although installation does not automatically have local repositories. The first thing you need to do is get down all the information, packages and other data repositories that we want locally, although, for it, the\u00a0first thing you should do is to set the apt-mirror configuration file, which would be in \/etc\/apt\/mirror.list.<\/p>\n<p>The file would consist of three sections: Configuration, repositories to be obtained, repositories to be cleaned. The most important part would be the configuration, since it is the one that determines where to store the repositories, the architecture in which we want the repositories to be downloaded, etc. A real configuration file based on a Debian 8 with AMD64 architecture would be the next:<\/p>\n<pre class=\"plain:false plain-toggle:false copy:false popup:false lang:default decode:true\">############# config ##################\n#\nin September\u00a0 base_path\u00a0\u00a0\u00a0\u00a0 \/ var \/ spool \/ apt-mirror\n#\nin September\u00a0 mirror_path\u00a0\u00a0 $ base_path \/ mirror\nin September\u00a0 skel_path\u00a0\u00a0\u00a0\u00a0 $ base_path \/ skel\nin September\u00a0 var_path\u00a0\u00a0\u00a0\u00a0\u00a0 $ base_path \/ var\n# Set cleanscript $ var_path \/ clean.sh\nin September\u00a0 defaultarch amd64\n# Set postmirror_script $ var_path \/ postmirror.sh\n# Set run_postmirror 0\nin September\u00a0 nthreads\u00a0\u00a0\u00a0\u00a0\u00a0 20\nin September\u00a0 _tilde\u00a0 0\n#\n############# end config ##############\ndeb http:\/\/ftp.debian.org\/debian\/mswb main contrib non-free\ndeb-src http:\/\/ftp.debian.org\/debian\/mswb main contrib non-free\ndeb http:\/\/ftp.debian.org\/debian\/mswb-updates main contrib non-free\ndeb-src http:\/\/ftp.debian.org\/debian\/mswb-updates main contrib non-free\nclean http:\/\/ftp.debian.org\/debian<\/pre>\n<p>With this setup, we could unburden the &#8220;standard&#8221; Debian repositories 8 (mswb) in the directory\/var\/spool\/apt-mirror, within which we have three folders: The mirror folder, the skel folder, and var folder.<\/p>\n<p>With the changes saved, you only would have to run the command:<\/p>\n<p><span style=\"color: #9c059c;\"><em>apt-mirror<\/em><\/span><\/p>\n<p>This command will create the mirror folders, skel and var are created in the directory\/var\/spool\/apt-mirror and all information repositories are downloaded here. And in saying all would be ALL. In other words, we would be downloading the necessary information so that our team can become a repository.<\/p>\n<p>The size of the downloaded information would vary depending upon the amount of repositories we want to download, but for example, in my particular case, the discharge would be 47 GB. A download that will take a LOT of time. We could also choose fewer repositories in order to be smaller, but at a\u00a0conceptual level, this would be the process. Imagine that we have downloaded all the content. This would be downloaded, but this would not mean that it was accessible by other computers; Hence the need to have apache2 installed. Right now the \/var\/spool\/apt-mirror\/mirror directory would have to have the following structure inside it:<\/p>\n<p><a href=\"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/repository-diagram.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3828 size-full\" src=\"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/repository-diagram.png\" alt=\"debian repository diagram\" width=\"244\" height=\"320\" srcset=\"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/repository-diagram.png 244w, https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/repository-diagram-229x300.png 229w\" sizes=\"auto, (max-width: 244px) 100vw, 244px\" \/><\/a><\/p>\n<p>We want to be able to access web repositories, as we would with a real repository, but on a local network. So we would have to make that content be accessed from the \/var\/www folder; move the contents to that folder would be cumbersome and also any future upgrades would be lowered again in the directory\/var\/spool\/apt-mirror, which as clean and practical would be to make a symbolic link to \/var \/www directories Desired; it would be only in this case the Debian directory which the symbolic link we would do the following:<\/p>\n<p><span style=\"color: #9c059c;\"><em>ln -s<\/em> <\/span>\/var\/spool\/apt-mirror\/mirror\/ftp.debian.org\/debian\/ \/var\/www\/debian. Now, to access the repositories of this machine, assume that it has the IP 192.168.1.101 to access repositories on the local network here, we would put these lines in the file \/etc\/apt\/sources.list<\/p>\n<pre class=\"plain:false plain-toggle:false copy:false popup:false lang:default decode:true\">deb http:\/\/192.168.1.101\/debian\/mswb main contrib non-free\ndeb-src http:\/\/192.168.1.10o\/debian\/mswb main contrib non-free\ndeb http:\/\/192.168.1.101\/debian\/mswb-updates main contrib non-free\ndeb-src http:\/\/192.168.1.101\/debian\/mswb-updates main contrib non-free<\/pre>\n<p>With this, we could access some repositories that are on the local network without needing to access the Internet.<\/p>\n<p>I hope you have found it useful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The repositories are invaluable in any Linux system, especially on those servers where we want to have the latest security updates. The most common thing is that\u00a0there is no impediment to using these, but what is normal does not imply that it has to happen always, either due to security policies\u00a0or if the repository is&#8230; <a class=\"read-more\" href=\"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/\">Read More<\/a><\/p>\n","protected":false},"author":1027,"featured_media":3834,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127],"tags":[],"class_list":["post-3822","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology-hub"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to create your own Debian repository | Creating Debian Repository<\/title>\n<meta name=\"description\" content=\"Want to learn the process to create your own Debian repository? Here is a step-by-step guide that can help you to follow the process by your own.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create your own Debian repository | Creating Debian Repository\" \/>\n<meta property=\"og:description\" content=\"Want to learn the process to create your own Debian repository? Here is a step-by-step guide that can help you to follow the process by your own.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting Blogs by MilesWeb | WordPress, Cloud &amp; SEO Tips\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-10T09:41:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-10T10:04:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/debian-logo-blog-post.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"315\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Rajesh Jadhav\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rajesh Jadhav\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/\",\"url\":\"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/\",\"name\":\"How to create your own Debian repository | Creating Debian Repository\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/debian-logo-blog-post.png\",\"datePublished\":\"2017-01-10T09:41:11+00:00\",\"dateModified\":\"2026-01-10T10:04:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/blog\/#\/schema\/person\/f7585120183be096ff9a96f8f2aa8194\"},\"description\":\"Want to learn the process to create your own Debian repository? Here is a step-by-step guide that can help you to follow the process by your own.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/debian-logo-blog-post.png\",\"contentUrl\":\"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/debian-logo-blog-post.png\",\"width\":800,\"height\":315},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to create your own Debian repository\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/blog\/#website\",\"url\":\"https:\/\/www.milesweb.in\/blog\/\",\"name\":\"Web Hosting Blogs by MilesWeb | WordPress, Cloud &amp; SEO Tips\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/blog\/#\/schema\/person\/f7585120183be096ff9a96f8f2aa8194\",\"name\":\"Rajesh Jadhav\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2025\/05\/rajesh-j.png\",\"contentUrl\":\"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2025\/05\/rajesh-j.png\",\"caption\":\"Rajesh Jadhav\"},\"description\":\"Rajesh, a content strategist with over 9 years of experience in content creation, emphasizes writing insightful, value-driven content that connects with readers. Whether it's writing blogs, press releases, web content, or social media posts, he ensures every word serves a purpose.\",\"url\":\"https:\/\/www.milesweb.in\/blog\/author\/rajesh-jadhav\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to create your own Debian repository | Creating Debian Repository","description":"Want to learn the process to create your own Debian repository? Here is a step-by-step guide that can help you to follow the process by your own.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/","og_locale":"en_US","og_type":"article","og_title":"How to create your own Debian repository | Creating Debian Repository","og_description":"Want to learn the process to create your own Debian repository? Here is a step-by-step guide that can help you to follow the process by your own.","og_url":"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/","og_site_name":"Web Hosting Blogs by MilesWeb | WordPress, Cloud &amp; SEO Tips","article_published_time":"2017-01-10T09:41:11+00:00","article_modified_time":"2026-01-10T10:04:41+00:00","og_image":[{"width":800,"height":315,"url":"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/debian-logo-blog-post.png","type":"image\/png"}],"author":"Rajesh Jadhav","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rajesh Jadhav","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/","url":"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/","name":"How to create your own Debian repository | Creating Debian Repository","isPartOf":{"@id":"https:\/\/www.milesweb.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/debian-logo-blog-post.png","datePublished":"2017-01-10T09:41:11+00:00","dateModified":"2026-01-10T10:04:41+00:00","author":{"@id":"https:\/\/www.milesweb.in\/blog\/#\/schema\/person\/f7585120183be096ff9a96f8f2aa8194"},"description":"Want to learn the process to create your own Debian repository? Here is a step-by-step guide that can help you to follow the process by your own.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/#primaryimage","url":"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/debian-logo-blog-post.png","contentUrl":"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2017\/01\/debian-logo-blog-post.png","width":800,"height":315},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/blog\/technology-hub\/create-debian-repository\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/blog\/"},{"@type":"ListItem","position":2,"name":"How to create your own Debian repository"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/blog\/#website","url":"https:\/\/www.milesweb.in\/blog\/","name":"Web Hosting Blogs by MilesWeb | WordPress, Cloud &amp; SEO Tips","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/blog\/#\/schema\/person\/f7585120183be096ff9a96f8f2aa8194","name":"Rajesh Jadhav","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2025\/05\/rajesh-j.png","contentUrl":"https:\/\/www.milesweb.in\/blog\/wp-content\/uploads\/2025\/05\/rajesh-j.png","caption":"Rajesh Jadhav"},"description":"Rajesh, a content strategist with over 9 years of experience in content creation, emphasizes writing insightful, value-driven content that connects with readers. Whether it's writing blogs, press releases, web content, or social media posts, he ensures every word serves a purpose.","url":"https:\/\/www.milesweb.in\/blog\/author\/rajesh-jadhav\/"}]}},"views":5644,"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/blog\/wp-json\/wp\/v2\/posts\/3822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/blog\/wp-json\/wp\/v2\/users\/1027"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/blog\/wp-json\/wp\/v2\/comments?post=3822"}],"version-history":[{"count":11,"href":"https:\/\/www.milesweb.in\/blog\/wp-json\/wp\/v2\/posts\/3822\/revisions"}],"predecessor-version":[{"id":16188,"href":"https:\/\/www.milesweb.in\/blog\/wp-json\/wp\/v2\/posts\/3822\/revisions\/16188"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/blog\/wp-json\/wp\/v2\/media\/3834"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/blog\/wp-json\/wp\/v2\/media?parent=3822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/blog\/wp-json\/wp\/v2\/categories?post=3822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/blog\/wp-json\/wp\/v2\/tags?post=3822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}