Skip to content
Blog Akash Rajpurohit

Self-Hosting selfh.st/icons With Git-Sync

Learn how to self-host the beautiful selfh.st/icons collection and keep it synchronized with the upstream repository using git-sync

Self-Hosting selfh.st/icons With Git-Sync

selfh.st/icons is a beautiful collection of open-source icons designed specifically for modern dashboards, websites, and applications. With over 1000+ icons available in SVG, PNG, and WebP formats, it provides a consistent and minimalist design language that can enhance your user interfaces.

What is selfh.st/icons?

The project offers a comprehensive set of icons that are:

You can browse and use these icons directly from selfh.st/icons, but what if you want to self-host them for better control, reliability, and customization?

Self-hosting selfh.st/icons

The icons collection is available on GitHub at github.com/selfhst/icons. To self-host, you can:

  1. Clone the repository
git clone https://github.com/selfhst/icons.git
  1. Serve the static files using your preferred web server (Nginx, Apache, etc.)

However, the challenge comes when you want to keep your self-hosted instance up-to-date with the upstream repository. As new icons are added or existing ones are improved, you'd want these updates in your self-hosted version.

Automating updates with git-sync

This is where git-sync comes in handy. It's a simple yet powerful tool that helps you keep your repository in sync with an upstream repository automatically.

ℹ️
Before we proceed, I would like to call out that I am the developer behind the project "Git-Sync".

Recently, I released a new version which allows users to sync public repositories from other GitHub projects as well which is another perfect use-case for allowing users to self-host their selfh.st/icons repository.

For any questions specifically around the project, feel free to reach out to me directly.

Setting up git-sync

  1. First, install git-sync:

You can install the latest binary from the releases page or use the pre-build Docker image.

  1. Setup configuration file:

Once you have git-sync installed, you can create a configuration file to define the sync behavior. Here's an example configuration for keeping selfh.st/icons in sync with your self-hosted instance:

raw_git_urls: ['https://github.com/selfhst/icons']
backup_dir: /path/to/backup
clone_type: full

Save this file as config.yaml under ~/.config/git-sync/ directory.

  1. Run git-sync:

Run the following command to start the sync process:

git-sync

This will clone the repository (if not already cloned) and keep it in sync with the cloud repository.

This is a one-time sync process, but if you want to keep it in sync with the cloud repository, you can setup a cron job to run the git-sync command at a regular interval or use the --cron flag to run it periodically and keep the service running in the background (more preferred way if you are running it via Docker).

More details about setting up git-sync can be found in the git-sync documentation.

Benefits of using git-sync

Conclusion

Self-hosting selfh.st/icons gives you complete control over your icon collection while git-sync ensures you're always in sync with the latest updates. This setup is perfect for:

By combining selfh.st/icons with git-sync, you get the best of both worlds: a beautiful, comprehensive icon collection and automated synchronization to keep everything up-to-date.

Akash Rajpurohit is a software engineer with a passion for self-hosting, writing, and playing around with new technologies. Akash also publishes articles about self-hosting on his own blog, akashrajpurohit.com, and can be contacted via his site's contact form.