---
title: "Master Your Configuration Files with a Git-Based Dotfiles Strategy"
lang: "en"
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/post/dotfiles
---

![Blog post image for Dotfiles: A Git-Based Strategy for Configuration Management - A Git-based strategy for managing your dotfiles with a bare repository, so your configuration files stay synchronized and secure across every machine you use.](/_astro/hero.wfzXy7kc_1fE0VT.webp)

[Home](/)›[Blog](/blog)›[All Categories](/blog/categories)›[Linux](/blog/categories/linux)

Blog

[Next in LinuxGit SSH Keys for GitHub, GitLab, and Bitbucket on Linux](/blog/post/git-ssh-keys-for-github-gitlab-and-bitbucket-on-linux)

[Linux](/blog/categories/linux)[Git](/blog/categories/git)[Configuration Management](/blog/categories/configuration-management)[Developer Tools](/blog/categories/developer-tools)[Productivity](/blog/categories/productivity)

# Dotfiles: A Git-Based Strategy for Configuration Management

[Mohammad Abu Mattar](/authors/mohammad-abu-mattar)Published: 27 May 2022Updated: 08 Jun 202607 Mins read12 Mins listen

[Markdown for AI(opens in a new tab)](/post/dotfiles/index.md "Open the plain-Markdown version of this page, for pasting into an AI tool")

TL;DR

A Git-based strategy for managing your dotfiles with a bare repository, so your configuration files stay synchronized and secure across every machine you use.

Series

[Developer Environment & Tooling](/series/developer-environment--tooling)1/4

[NextVIM Cheat Sheet](/blog/post/vim-cheat-sheet)

All posts in this series (4)

Blog4

1.  [Dotfiles: A Git-Based Strategy for Configuration ManagementYou are here](/blog/post/dotfiles)
2.  [VIM Cheat Sheet](/blog/post/vim-cheat-sheet)
3.  [Customization Windows Terminal With Starship](/blog/post/customization-windows-terminal-with-starship)
4.  [10+ Secret Git Commands That Will Save Hours Every Week](/blog/post/10-secret-git-commands-to-save-time)

### Dotfiles: A Git-Based Strategy for Configuration Management

Contents

[Introduction](#introduction)[Prerequisites](#prerequisites)[Strategy 1: The bare Git repository](#strategy-1-the-bare-git-repository)[Initial setup](#initial-setup)[Adding and committing dotfiles](#adding-and-committing-dotfiles)[Replicating your environment on a new machine](#replicating-your-environment-on-a-new-machine)[Strategy 2: A modular repo + a bootstrap script](#strategy-2-a-modular-repo--a-bootstrap-script)[Repository layout](#repository-layout)[Quick start](#quick-start)[What the bootstrap does](#what-the-bootstrap-does)[Opting modules in and out](#opting-modules-in-and-out)[Self-documenting: man pages for everything](#self-documenting-man-pages-for-everything)[Built against reusable skills](#built-against-reusable-skills)[Which should you choose?](#which-should-you-choose)[Conclusion](#conclusion)[References](#references)

## [Introduction](#introduction)

Your dotfiles, those hidden `.`\-prefixed configuration files scattered across your home directory, are the muscle memory of your environment. They hold your shell aliases, your editor settings, your Git identity, your terminal theme. Lose them and a fresh machine feels like someone else’s computer. Version them, and any machine becomes _yours_ in a single clone.

This guide covers two battle-tested, Git-based strategies for managing them:

Worth knowing

Both approaches use plain Git, with no extra runtime and no proprietary format. They differ only in **how the files reach your home directory**: the bare repository checks them out in place, while the modular repository symlinks them in from a clone you control.

Strategy

How files land in `$HOME`

Best when

**Bare Git repository**

Checked out directly into home

You want zero tooling and zero symlinks

**Modular repo + bootstrap**

Symlinked from a normal clone

You want modularity, opt-in modules, and man pages

Pick whichever fits your taste. Both are shown below in full.

## [Prerequisites](#prerequisites)

You’ll be pushing your configuration to a private remote, so set up SSH first if you haven’t. My companion guide walks through it end to end: [Git SSH Keys for GitHub, GitLab, and Bitbucket on Linux](/blog/post/git-ssh-keys-for-github-gitlab-and-bitbucket-on-linux). New to the shell in general? Start with [Introduction to Linux CLI](/blog/post/introduction-to-linux-cli).

Tip

Set your Git identity before committing anything, so the history is attributed correctly from the very first commit:

Set global Git identity

```
1git config --global user.name 'YOUR_NAME'2git config --global user.email 'YOUR_EMAIL@EXAMPLE.COM'
```

## [Strategy 1: The bare Git repository](#strategy-1-the-bare-git-repository)

The classic trick: initialize a **bare** repository in a discrete folder (`$HOME/.dotfiles`) and point its work-tree at `$HOME`. No symlinks, no copying. Your real home directory _becomes_ the work-tree.

### [Initial setup](#initial-setup)

1.  Create a bare Git repository in your home directory:

Create a bare Git repository

```
1git init --bare $HOME/.dotfiles
```

2.  Add a `config` alias to your shell profile so you can run Git against that repo from anywhere. Pick the tab for your shell:

-   [Bash](#tab-panel-8)
-   [Zsh](#tab-panel-9)

~/.bashrc

```
1alias config='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
```

~/.zshrc

```
1alias config='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
```

3.  Tell Git not to show every untracked file in `$HOME` (which would be thousands), so `config status` stays readable:

Hide untracked files

```
1config config --local status.showUntrackedFiles no
```

With the `config` alias in place, you now drive your dotfiles with ordinary Git commands. Just type `config` where you’d normally type `git`.

### [Adding and committing dotfiles](#adding-and-committing-dotfiles)

Version-controlling a file is exactly like a normal repo, using `config` instead of `git`:

Add and commit your shell + editor config

```
1config add .vimrc .bashrc .zshrc2config commit -m 'Add shell and editor config'
```

Then publish to a private remote for safekeeping and easy sync. Use the **SSH** remote so you never type credentials:

Push to a remote repository

```
1config remote add origin git@github.com:YOUR_USERNAME/dotfiles.git2config branch -M main3config push -u origin main
```

Careful here

Treat this repo like any other public-facing thing: **never commit secrets**. Keep API tokens, SSH private keys, and `.netrc`\-style credentials out of it, and add them to a `.gitignore` (tracked in the repo) before your first push.

### [Replicating your environment on a new machine](#replicating-your-environment-on-a-new-machine)

On a fresh box, add the `config` alias to your shell profile, then clone the repo as **bare** into `$HOME/.dotfiles`:

Clone the dotfiles repository (bare)

```
1git clone --bare git@github.com:YOUR_USERNAME/dotfiles.git $HOME/.dotfiles
```

Now check the files out into `$HOME`. If files like `.bashrc` already exist, Git refuses to overwrite them. This one-liner backs up any conflicts, then checks out cleanly:

Check out into $HOME (backing up conflicts)

```
1mkdir -p .dotfiles-backup && \2config checkout 2>&1 | egrep "\s+\." | awk '{print $1}' | \3xargs -I{} mv {} .dotfiles-backup/{}4config checkout -f5config config --local status.showUntrackedFiles no
```

That’s it. Your environment is restored, and `config status` is clean.

## [Strategy 2: A modular repo + a bootstrap script](#strategy-2-a-modular-repo--a-bootstrap-script)

The bare-repo trick is elegant, but everything lives as one flat checkout. Once your config grows to hold aliases, shell functions, plugins, per-app configs, even your own CLI tools, you’ll want **structure** and **opt-in modules**. The approach I actually run does exactly that: a normal Git repo of organized modules, symlinked into place by an idempotent `setup` script.

You can browse the real thing here: [github.com/MKAbuMattar/dotfiles](https://github.com/MKAbuMattar/dotfiles).

### [Repository layout](#repository-layout)

-   Directorydotfiles/
    
    -   Directory.aliases/ per-tool alias modules (35 modules)
        
        -   …
        
    -   Directory.utils/ per-tool shell function libraries (17 modules)
        
        -   …
        
    -   Directory.plugins/ zsh plugins + Python CLI plugins
        
        -   …
        
    -   Directory.zsh/ core zsh settings (options, completion, keybindings)
        
        -   …
        
    -   Directory.config/ third-party app configs (kitty, btop, mpv, …)
        
        -   …
        
    -   Directory.docs/ markdown man-page sources (the source of truth)
        
        -   …
        
    -   Directory.man/ generated roff man pages
        
        -   …
        
    -   Directory.scripts/ build & maintenance scripts
        
        -   …
        
    -   Directory.agents/ Claude Code skills used to author this repo
        
        -   …
        
    -   **.zshrc** the entry point you opt modules in/out from
    -   **setup** one-shot bootstrap (idempotent; safe to re-run)
    -   README.md
    

Instead of dumping files in `$HOME`, each subtree is **symlinked** into `~/.config/.dotfiles`, and `~/.zshrc` is symlinked to the repo’s `.zshrc`. The clone stays the single source of truth. Edit a file in the repo and your live config updates instantly, because it _is_ the same file.

### [Quick start](#quick-start)

1.  Clone the repository somewhere stable (not directly in `$HOME`):

Clone the dotfiles

```
1git clone git@github.com:MKAbuMattar/dotfiles.git ~/Work/dotfiles2cd ~/Work/dotfiles
```

2.  Run the bootstrap script. It’s idempotent. Re-running it detects the symlinks that are already correct and skips them, and it prompts before overwriting anything else:

Bootstrap the environment

```
1./setup
```

3.  Reload your shell (or just open a new terminal):

Reload zsh

```
1source ~/.zshrc
```

Here’s roughly what a first run looks like:

zsh

$

### [What the bootstrap does](#what-the-bootstrap-does)

1.  **Symlinks** the repo (or its individual subtrees) into `~/.config/.dotfiles`.
2.  **Links** `~/.zshrc` to the repo’s `.zshrc`.
3.  **Builds** a modular `~/.gitconfig` `[include]` block from every `*.gitconfig` shipped in `.config/gitconfig/`.
4.  **Generates** the man pages from `.docs/` and refreshes the `apropos` index.
5.  **Verifies** that `git` and `zsh` are installed, and **backs up** any pre-existing non-symlink target before replacing it.

Note

Because the bootstrap only ever creates symlinks and backs up conflicts before touching them, it’s safe to re-run after every `git pull`. Nothing of yours gets clobbered.

### [Opting modules in and out](#opting-modules-in-and-out)

The payoff of a modular layout: you choose what loads. The arrays in [`.zshrc`](https://github.com/MKAbuMattar/dotfiles/blob/main/.zshrc) are the control panel. Comment a line out and that module simply doesn’t load:

~/.zshrc

```
1UTILS=("clipboard" "fedora" "git" "npm" "python")    # shell functions2PLUGINS=("aws" "docker" "fzf" "git" "kubectl")       # completion / integration3ALIASES=("docker" "exa" "general" "git" "npm")       # short command aliases
```

After editing, reload with Ctrl + C then `source ~/.zshrc`, or just open a new terminal.

### [Self-documenting: man pages for everything](#self-documenting-man-pages-for-everything)

Every module ships an AWS-style markdown man page, compiled to real roff pages so `man <module>` and `apropos <keyword>` work for your own config exactly like they do for system tools:

zsh

$

### [Built against reusable skills](#built-against-reusable-skills)

The scripts in this repo aren’t ad-hoc. The `setup` bootstrap and the Python CLI tools are written against two **agent skills** I maintain. They’re shared specs that encode strict Bash and Python patterns plus a validator, so quality stays consistent across machines and contributors. You can grab both for your own scripting from my skills repository: **[github.com/MKAbuMattar/skills](https://github.com/MKAbuMattar/skills)**.

-   **`linux-script-developer`**: strict Bash patterns plus a validator the `setup` script passes at 100%.
-   **`python-script-developer`**: strict Python patterns plus a validator every shipped Python plugin passes at 100%.

Worth knowing

Want the same guardrails on your own scripts? Pull the skills from [github.com/MKAbuMattar/skills](https://github.com/MKAbuMattar/skills). They are the exact specs (patterns + validators) the `setup` script and every Python plugin in the dotfiles are built and checked against.

If you fork the dotfiles and add a script, run the matching validator to keep it in line:

Validate a new script against the skill

```
1bash    .agents/skills/linux-script-developer/scripts/validate-script.sh  ./your-script.sh2python3 .agents/skills/python-script-developer/scripts/validate-script.py ./your-script.py
```

Tip

Once your shell is dialed in, give the terminal itself some polish: a prompt, colors, icons. My guide on [customizing the terminal with Starship](/blog/post/customization-windows-terminal-with-starship) pairs perfectly with a modular dotfiles setup.

## [Which should you choose?](#which-should-you-choose)

Use the **bare Git repository** (Strategy 1). There’s nothing to install and nothing to symlink. Your home directory is the work-tree, and `config` is just `git` with a different `--git-dir`. It’s the fastest path from “unmanaged” to “versioned and synced.”

Use the **modular repo + bootstrap** (Strategy 2). Splitting aliases, functions, plugins, and app configs into separate files keeps everything navigable, and a `setup` script makes a new machine reproducible in one command. The symlink model also means editing the repo updates your live config instantly.

Yes. Your files are already in Git either way. Move them into a structured layout, write (or borrow) a `setup` script that symlinks them, and point your shell at the new location. Nothing about the bare approach locks you in.

Never commit credentials. Keep a tracked `.gitignore` that excludes things like `~/.ssh/id_*`, `.netrc`, and any `*.env` files, and load real secrets from a separate, untracked file your shell sources only if it exists (e.g. `[[ -f ~/.secrets ]] && source ~/.secrets`).

## [Conclusion](#conclusion)

Whichever strategy you pick, the win is the same: your environment stops being a fragile, one-of-a-kind artifact and becomes something reproducible, reviewable, and one `git clone` away. Start with the bare repo if you want to be versioned in five minutes; graduate to a modular repo with a bootstrap script when your config earns the structure. Either way, the next machine you sign in to will already feel like home.

## [References](#references)

-   [The best way to store your dotfiles: A bare Git repository](https://www.atlassian.com/git/tutorials/dotfiles) (Atlassian)
-   [MKAbuMattar/dotfiles the modular repo + bootstrap shown above](https://github.com/MKAbuMattar/dotfiles)
-   [MKAbuMattar/skills the linux- and python-script-developer skills](https://github.com/MKAbuMattar/skills)
-   [Hacker News Discussion on Dotfiles Management](https://news.ycombinator.com/item?id=11070797)
-   [Managing Dotfiles With a Bare Git Repository](https://harfangk.github.io/2016/09/18/manage-dotfiles-with-a-git-bare-repository.html)
-   [Dotfiles.github.io A guide to dotfiles on GitHub](https://dotfiles.github.io/)
-   [Using Git and GitHub to manage your dotfiles](https://www.anishathalye.com/2014/08/03/managing-your-dotfiles/) (Anish Athalye)
-   [Ask HN: How do you manage your dotfiles?](https://news.ycombinator.com/item?id=2509090)
-   [Git Bare Repository A Better Way To Manage Dotfiles](https://driesvints.com/blog/using-a-git-bare-repository-to-manage-your-dotfiles/) (Dries Vints)
-   [ArchWiki: Dotfiles](https://wiki.archlinux.org/title/Dotfiles)
-   [GitHub Does Dotfiles](https://github.blog/2021-02-10-github-does-dotfiles/) (GitHub Blog)
-   [GNU Stow for dotfiles management](https://www.gnu.org/software/stow/) (Alternative approach)
-   [Chezmoi Manage your dotfiles across multiple diverse machines, securely](https://www.chezmoi.io/) (Popular dotfiles manager tool)
-   [YADM Yet Another Dotfiles Manager](https://yadm.io/) (Another popular tool)
-   [Understanding Git —bare repositories](https://www.saintsjd.com/2011/01/what-is-a-bare-git-repository/)
-   [Stack Overflow: What is a bare git repository?](https://stackoverflow.com/questions/219977/what-is-a-bare-git-repository)

Was this useful?

## Tags

[#Dotfiles Management](/blog/tags/dotfiles-management)[#Git Bare Repository](/blog/tags/git-bare-repository)[#Shell Configuration](/blog/tags/shell-configuration)[#Environment Setup](/blog/tags/environment-setup)[#Version Control](/blog/tags/version-control)[#.bashrc](/blog/tags/bashrc)[#.vimrc](/blog/tags/vimrc)[#CLI Tools](/blog/tags/cli-tools)[#Symlinks](/blog/tags/symlinks)[#Zsh](/blog/tags/zsh)

## Share

[Facebook](https://facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fdotfiles "Share on Facebook")[Twitter](https://twitter.com/intent/tweet/?text=Dotfiles%3A%20A%20Git-Based%20Strategy%20for%20Configuration%20Management&url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fdotfiles "Share on Twitter")[LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fdotfiles&title=Dotfiles%3A%20A%20Git-Based%20Strategy%20for%20Configuration%20Management&summary=A%20Git-based%20strategy%20for%20managing%20your%20dotfiles%20with%20a%20bare%20repository%2C%20so%20your%20configuration%20files%20stay%20synchronized%20and%20secure%20across%20every%20machine%20you%20use.&source=https://mkabumattar.com "Share on LinkedIn")[WhatsApp](https://wa.me/?text=Dotfiles%3A%20A%20Git-Based%20Strategy%20for%20Configuration%20Management%20https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fdotfiles "Share on WhatsApp")[Telegram](https://t.me/share/url?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fdotfiles&text=Dotfiles%3A%20A%20Git-Based%20Strategy%20for%20Configuration%20Management "Share on Telegram")[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fdotfiles&title=Dotfiles%3A%20A%20Git-Based%20Strategy%20for%20Configuration%20Management "Share on Reddit")[Hacker News](http://news.ycombinator.com/submitlink?u=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fdotfiles&t=Dotfiles%3A%20A%20Git-Based%20Strategy%20for%20Configuration%20Management "Share on Hacker News")[Pinterest](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fdotfiles&media=&description=A%20Git-based%20strategy%20for%20managing%20your%20dotfiles%20with%20a%20bare%20repository%2C%20so%20your%20configuration%20files%20stay%20synchronized%20and%20secure%20across%20every%20machine%20you%20use. "Share on Pinterest")[Email](<mailto:?subject=Dotfiles%3A%20A%20Git-Based%20Strategy%20for%20Configuration%20Management&body=Check out this article: https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fdotfiles>)

## Comments

## You might also enjoy

More posts on similar topics

[![10+ Secret Git Commands That Will Save Hours Every Week](/_astro/hero.BrIIpyXb_8Js6X.webp)](/blog/post/10-secret-git-commands-to-save-time)

## [10+ Secret Git Commands That Will Save Hours Every Week](/blog/post/10-secret-git-commands-to-save-time)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Git](/blog/categories/git)
-   [Version Control](/blog/categories/version-control)
-   [DevOps](/blog/categories/devops)
-   [Software Development](/blog/categories/software-development)
-   [Productivity](/blog/categories/productivity)

Introduction As a software engineer, DevOps engineer, or GitHub user, you probably use Git daily. But are you making the most of it? Git is packed with commands that can save you hours of manual w

[#Git Commands](/blog/tags/git-commands)[#Git Tips](/blog/tags/git-tips)[#Version Control](/blog/tags/version-control)+7 tags

[read more](/blog/post/10-secret-git-commands-to-save-time)

[![VIM Cheat Sheet](/_astro/hero.Buk-UDGW_2r0YqI.webp)](/blog/post/vim-cheat-sheet)

## [VIM Cheat Sheet](/blog/post/vim-cheat-sheet)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Linux](/blog/categories/linux)
-   [VIM](/blog/categories/vim)
-   [Text Editors](/blog/categories/text-editors)
-   [Developer Tools](/blog/categories/developer-tools)
-   [Command Line](/blog/categories/command-line)

What is VIM? VIM (Vi Improved) is a versatile text editor pre-installed on most Linux systems, known for its efficiency in command-line file editing. Its modal nature, switching between modes like

[#VIM Commands](/blog/tags/vim-commands)[#VIM Cheat Sheet](/blog/tags/vim-cheat-sheet)[#Text Editing](/blog/tags/text-editing)+5 tags

[read more](/blog/post/vim-cheat-sheet)

[![Customization Windows Terminal With Starship](/_astro/hero.C_M2lGhc_1GJQQi.webp)](/blog/post/customization-windows-terminal-with-starship)

## [Customization Windows Terminal With Starship](/blog/post/customization-windows-terminal-with-starship)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Windows](/blog/categories/windows)
-   [Terminal](/blog/categories/terminal)
-   [PowerShell](/blog/categories/powershell)
-   [Starship](/blog/categories/starship)
-   [Customization](/blog/categories/customization)
-   [Developer Tools](/blog/categories/developer-tools)

Introduction In this article, we will install PowerShell and Starship, configure Windows Terminal, and then customize it with Starship. What is Windows Terminal? Windows Terminal is a modern

[#Windows Terminal](/blog/tags/windows-terminal)[#Starship Prompt](/blog/tags/starship-prompt)[#PowerShell Customization](/blog/tags/powershell-customization)+7 tags

[read more](/blog/post/customization-windows-terminal-with-starship)

[![Git SSH Keys for GitHub, GitLab, and Bitbucket on Linux](/_astro/hero.ohMeiGHZ_Z1ILCmY.webp)](/blog/post/git-ssh-keys-for-github-gitlab-and-bitbucket-on-linux)

## [Git SSH Keys for GitHub, GitLab, and Bitbucket on Linux](/blog/post/git-ssh-keys-for-github-gitlab-and-bitbucket-on-linux)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Linux](/blog/categories/linux)
-   [Git](/blog/categories/git)
-   [SSH](/blog/categories/ssh)
-   [Version Control](/blog/categories/version-control)
-   [Developer Tools](/blog/categories/developer-tools)

Introduction By default, Git talks to remotes over HTTPS, so it asks for your username and password on every git pull or git push. SSH fixes that. GitHub, GitLab, and Bitbucket all let Git aut

[#SSH Keys](/blog/tags/ssh-keys)[#Ed25519](/blog/tags/ed25519)[#GitHub SSH](/blog/tags/github-ssh)+8 tags

[read more](/blog/post/git-ssh-keys-for-github-gitlab-and-bitbucket-on-linux)

[![Git SSH Keys for GitHub, GitLab, and Bitbucket on Windows](/_astro/hero.CT0gfesP_1kDHLR.webp)](/blog/post/git-ssh-keys-for-github-gitlab-and-bitbucket-on-windows)

## [Git SSH Keys for GitHub, GitLab, and Bitbucket on Windows](/blog/post/git-ssh-keys-for-github-gitlab-and-bitbucket-on-windows)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Git](/blog/categories/git)
-   [SSH](/blog/categories/ssh)
-   [Windows](/blog/categories/windows)
-   [Version Control](/blog/categories/version-control)
-   [Security](/blog/categories/security)
-   [Developer Tools](/blog/categories/developer-tools)

Introduction By default, Git talks to remotes over HTTPS, so it asks for your username and password on every git pull or git push. SSH fixes that. GitHub, GitLab, and Bitbucket all let Git aut

[#SSH Key Generation](/blog/tags/ssh-key-generation)[#Ed25519](/blog/tags/ed25519)[#Git Configuration](/blog/tags/git-configuration)+8 tags

[read more](/blog/post/git-ssh-keys-for-github-gitlab-and-bitbucket-on-windows)

[![How to Install and Setup FireWall on Amazon Linux 2](/_astro/hero.b8oDtFR4_ZdWcUP.webp)](/blog/post/how-to-install-and-setup-firewall-on-amazon-linux-2)

## [How to Install and Setup FireWall on Amazon Linux 2](/blog/post/how-to-install-and-setup-firewall-on-amazon-linux-2)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [EC2](/blog/categories/ec2)
-   [Linux](/blog/categories/linux)
-   [Firewall](/blog/categories/firewall)
-   [Security](/blog/categories/security)

Introduction This tutorial covers installing and configuring firewalld on Amazon Linux 2, including setting the default zone and managing services and ports. Prerequisites To follow along wit

[#Firewalld](/blog/tags/firewalld)[#Amazon Linux 2](/blog/tags/amazon-linux-2)[#EC2 Security](/blog/tags/ec2-security)+5 tags

[read more](/blog/post/how-to-install-and-setup-firewall-on-amazon-linux-2)

6 related posts
