Deploy Gitea on Railway: Get Free Personal Git Hosting without Credit Cards Deploy Gitea on Railway: Get Free Personal Git Hosting without Credit Cards

Deploy Gitea on Railway: Get Free Personal Git Hosting without Credit Cards

This article contains affiliate links. This means that if you purchase something through these links, I receive a commission at no additional cost to you. I cannot guarantee the quality of any product since I present product descriptions based on information provided by the publisher/seller. However, if you find a bad product, please do let me know. If you like my work, please consider purchasing through affiliate links to support me.

Having your own personal Github to show off your projects is a very cool idea, isn’t it? But, who wants to pay those extra bucks just for that, right?. What if I told you that you can have your very own Git service, attached with your personal domain name, completely for free? Yes, it’s possible. Don’t worry! You wouldn’t even need a credit card. Read on to find out. We will deploy Gitea, a self-hosted Git service, on Railway.

Why Deploy Gitea on Railway?

  • Cool self-branding - Having your own git service looks very cool and professional
  • Lightweight and fast - Gitea uses minimal resources
  • Awesome free tier - Railway’s free tier is very generous and enough to run Gitea. They will grant you $5 Railway credits for the first month on free trial. You can even get $20 credits if you use my affiliate link. After that, you’ll get $1 each month for free.
  • No credit cards - A big plus for Railway’s free tier is that they don’t require credit cards
  • Block AI crawlers - You can block AI crawler bots on your Git service if you own a domain

How to Deploy Gitea on Railway

1. Step-by-Step Deployment

  1. Visit Railway homepage and select Sign in from the top right corner. You have to choose this option even if you have no accounts. The account will be created once you sign in. Make sure to use my affiliate link so that you get the bonus $20 Railway credits.

  2. After signing in, create a new workspace.

  3. Inside your environment, click Add a Service or press CTRL + K. Choose Docker Image. Input the name of the image: gitea/gitea:latest.

  4. Now, right click on the service and select Attach volume. Input /data as the mount path of the volume.

  5. Now, click Deploy at the top. Your very own Git service will start cooking now!

Using a custom domain as git.yourdomain.com adds to the coolness. But, you have to own a domain for that. To add a custom domain in Railway’s settings:

  • Go to your service → Settings → Networking

  • Add your custom domain from the option under Public Networking. Then, configure your domain’s DNS records.

Alright! Now, enjoy a cool git.yourdomain.com for your projects! Don’t forget to share it with your friends and in our comments section, too.

⚠️ Warning: When your trial finishes and you’re on free plan, never remove the custom domain. Else, you can’t add it again as free plan doesn’t support custom domains!

Note: If you don’t own a domain, you can choose Generate Domain to publicize your service. It will generate a subdomain with *.railway.app. The default port used in Gitea docker image is 3000. Enter it when asked. You can also edit the generated URL to make it look more personalized.

Initial Configuration

  1. Visit the URL of your Gitea service. You will see an initial setup screen now.

  2. First of all, change the Site Title to provide a personalized name. For example, mine is Khalid’s Git.

  3. Change the Server Domain and Gitea Base URL if not correct.

  4. Under Server and Third-Party Service Settings, do the following:

    • Uncheck Enable Local Mode to reduce resource usage
    • Tick Disable Self-Registration if you plan to use it alone
      • Untick Enable OpenID Sign-In
      • Untick Enable OpenID Self-Registration

Rest of the settings are fine by default. Enable/Disable them as you need.

  1. Under Administrator Account Settings, create your Administrator account. Note that you might want to use owner or admin as username instead of your own name, if you have used a custom domain by your name. Else, the repository URLs will have your name duplicated.

  2. After all are done, click Install Gitea. Your configuration will be written into /data/gitea/conf/app.ini. From there, you can change any settings you have configured here as well as everything else.

Tips

  1. Railway charges based on your usage. So, make sure to keep resource usage low. Only host your important projects in this service. With $1 credit, you can’t really do much. So, consider subscribing if you need more.

  2. Control bot traffic, especially AI crawlers. They consume a lot of resources and might eat up your credits. Beware!

  3. You can also mirror a repository with Github if you don’t wanna miss out. Both ways of mirroring (pull/push) are supported.


Congrats! Now, you have your very own cool git service!! Take a look around Gitea interface, adjust settings as needed, and, most importantly, create your first repository. Share your Git URL in the comment section to let me and visitors of Khalid’s Shell know about your awesome projects. If you’re ever stuck, consult Gitea Docs. You can also ask me for help.


← Back to articles

How was the article?