{"id":5490,"date":"2026-08-30T21:30:34","date_gmt":"2026-08-30T12:30:34","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/linux-proxy-settings-cheatsheet-2\/"},"modified":"2026-08-30T21:30:36","modified_gmt":"2026-08-30T12:30:36","slug":"linux-proxy-settings-cheatsheet","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/server-tech\/linux-server-network\/linux-proxy-settings-cheatsheet\/","title":{"rendered":"Linux Proxy Configuration Complete Cheat Sheet (apt, yum, dnf, npm, wget, curl, git, k8s\/containerd, OS Environment Variables)"},"content":{"rendered":"<p>When building a Linux environment behind a proxy, proxy configuration methods vary by tool, which often wastes time on troubleshooting every time. To solve this, I have compiled a cheat sheet covering the proxy configuration methods (with authentication) for the 10 most frequently used tools in Linux environments.<\/p>\n<h2>Eliminating Proxy Configuration Hesitation<\/h2>\n<p>The main objective of this article is to centralize proxy configuration methods for major applications in Linux environments, preventing wasted time caused by misconfigurations or syntax errors. By focusing particularly on tools that frequently appear in development workflows, we provide a reference that allows you to complete configuration tasks without hesitation. This creates an environment where developers can focus on their core responsibilities\u2014design and implementation\u2014rather than infrastructure settings.<\/p>\n<h2>Communications for 10 Major Tools<\/h2>\n<p>This covers communication settings for a total of 10 major tools, ranging from system-wide OS environment variables, package managers (apt\/apt-get, yum, dnf, npm), download tools (wget, curl), version control (git), to container orchestration (Kubernetes\/containerd).<\/p>\n<h2>Main Factors Complicating Proxy Configuration<\/h2>\n<p>Proxy configuration is typically complicated by the following two factors.<br \/>\nFirst, configuration files are split between those applied system-wide (under \/etc) and those applied per-user (under the home directory), and their formats differ (case sensitivity, presence or absence of equals signs, etc.).<br \/>\nSecond, in authenticated proxies, if the password contains special characters such as &#8220;@&#8221; or &#8220;:&#8221;, it causes URL parsing errors. These must be escaped using percent-encoding (e.g., converting @ to %40).<\/p>\n<h2>Linux Proxy Configuration Cheat Sheet<\/h2>\n<p>This quick reference guide assumes an authenticated proxy (e.g., [http:\/\/user:pass@proxy.example.com:8080\/](http:\/\/user:pass@proxy.example.com:8080\/)). These configuration details are basically common and applicable across Ubuntu LTS versions 22.04, 24.04, and 26.04. Notes on differences across Ubuntu LTS versions.<\/p>\n<h3>OS Environment Variables<\/h3>\n<p>Basic environment variables applied system-wide.<br \/>\nTarget file: \/etc\/environment<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nhttp_proxy=&quot;http:\/\/user:pass@proxy.example.com:8080\/&quot;\nhttps_proxy=&quot;http:\/\/user:pass@proxy.example.com:8080\/&quot;\nno_proxy=&quot;localhost,127.0.0.1,.example.com&quot;\n<\/pre>\n<h3>apt \/ apt-get<\/h3>\n<p>Configuration for Debian-based package managers such as Ubuntu.<br \/>\nTarget file: \/etc\/apt\/apt.conf.d\/proxy.conf<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nAcquire::http::Proxy &quot;http:\/\/user:pass@proxy.example.com:8080\/&quot;;\nAcquire::https::Proxy &quot;http:\/\/user:pass@proxy.example.com:8080\/&quot;;\n<\/pre>\n<h3>yum \/ dnf<\/h3>\n<p>Configuration for package managers used in Red Hat-based OSs.<br \/>\nTarget file: \/etc\/yum.conf or \/etc\/dnf\/dnf.conf<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nproxy=http:\/\/proxy.example.com:8080\/\nproxy_username=user\nproxy_password=pass\n<\/pre>\n<h3>npm<\/h3>\n<p>Configuration for Node.js package manager. Executed via command and saved to ~\/.npmrc.<br \/>\nCommand execution:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nnpm config set proxy http:\/\/user:pass@proxy.example.com:8080\/\nnpm config set https-proxy http:\/\/user:pass@proxy.example.com:8080\/\n<\/pre>\n<h3>wget<\/h3>\n<p>Configuration for the file download tool.<br \/>\nTarget file: ~\/.wgetrc or \/etc\/wgetrc<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nuse_proxy=on\nhttp_proxy=http:\/\/user:pass@proxy.example.com:8080\/\nhttps_proxy=http:\/\/user:pass@proxy.example.com:8080\/\n<\/pre>\n<h3>curl<\/h3>\n<p>Configuration for the tool used for API communication and file retrieval.<br \/>\nTarget file: ~\/.curlrc<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nproxy=&quot;http:\/\/user:pass@proxy.example.com:8080\/&quot;\n<\/pre>\n<h3>git<\/h3>\n<p>Configuration for the version control tool. Applied globally.<br \/>\nCommand execution:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ngit config --global http.proxy http:\/\/user:pass@proxy.example.com:8080\/\ngit config --global https.proxy http:\/\/user:pass@proxy.example.com:8080\/\n<\/pre>\n<h3>k8s (containerd)<\/h3>\n<p>Configuration for container runtimes used in Kubernetes, etc. Specified via Systemd.<br \/>\nTarget file: \/etc\/systemd\/system\/containerd.service.d\/http-proxy.conf<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;Service]\nEnvironment=&quot;HTTP_PROXY=http:\/\/user:pass@proxy.example.com:8080\/&quot;\nEnvironment=&quot;HTTPS_PROXY=http:\/\/user:pass@proxy.example.com:8080\/&quot;\nEnvironment=&quot;NO_PROXY=localhost,127.0.0.1,10.0.0.0\/8&quot;\n<\/pre>\n<p>After configuration, run the following commands to apply the changes.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsystemctl daemon-reload\nsystemctl restart containerd\n<\/pre>\n<h2>Notes on Differences Across Ubuntu LTS Versions<\/h2>\n<p>From Ubuntu 22.04 up to the latest 26.04, the basic syntax for proxy configuration across the aforementioned tools remains unchanged. However, note that the OS default network management tool has completely transitioned to Netplan, and the standard runtime in Kubernetes environments has completely shifted from Docker to containerd. Therefore, when troubleshooting container communication issues, you should prioritize checking the containerd proxy configuration via Systemd rather than OS environment variables.<\/p>\n<h2>Verifying External Communication Connectivity<\/h2>\n<p>After completing the configuration for each tool, verify whether communication is successful.<br \/>\nFor example, when using curl, run curl -I [https:\/\/google.com](https:\/\/google.com) and verify that the HTTP status code &#8220;200 OK&#8221; is returned. For apt, run apt update; if repository information is successfully retrieved, the configuration has been correctly applied. For container environments, test image retrieval with crictl pull docker.io\/library\/alpine or similar.<\/p>\n<h2>Conclusion<\/h2>\n<p>To prevent communication blocks caused by corporate proxies and to smoothly proceed with development environment setup, we have centralized the communication settings for the 10 major tools. The main challenges are the scattering of configuration files across tools and parsing errors caused by special characters in authentication information. To address this, we organized the precise configuration syntax ranging from OS environment variables to apt, npm, k8s, etc., into a cheat sheet. As a result, this eliminates guesswork in configuration tasks and enables the immediate establishment of stable communication with external networks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When building a Linux environment behind a proxy, proxy configuration methods vary by tool, which often wastes [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":3824,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=3819","footnotes":""},"categories":[1170],"tags":[1135,1142,1140,1137,18,51,52,1141,1138,1144,100,1139,1136,10,1145,103,1146,1143],"class_list":["post-5490","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-server-network","tag-apt","tag-containerd","tag-curl","tag-dnf","tag-docker","tag-git","tag-https","tag-k8s","tag-npm","tag-proxy","tag-ubuntu-22-04","tag-wget","tag-yum","tag-server","tag-1145","tag-103","tag-1146","tag-1143","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=5490"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5490\/revisions"}],"predecessor-version":[{"id":5493,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5490\/revisions\/5493"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/3824"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=5490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=5490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=5490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}