> There are rules to this one. Normally I don't make rules, but I've been pondering how to do this. So here goes:
>
> For each Gitea instance (everytime you run this script) the following rules apply:
>
> Each intance will have it's own user. i.e gitea1, gitea2 etc.\
> Each intance will have it's own local port. i.e 3001, 3002 etc.\
> Each instance will have it's own configuration file i.e giteainstance.app.ini\
> Each instance will have it's own service unit i.e you will end up with several systemctl restart gitea1 and systemctl restart gitea2 restart etc.\
> Each instance will share the same **Gitea Execuatable**. So if you update please make sure all owners of the other instances are notified.
### Logic
The first instance will be called:\
**gitea1** and the local port will be **3001** the database name will be **gitea1db** and the service to restart **gitea1.service**\
The second instance will be called:\
**gitea2** and the local port will be **3002** the database name will be **gitea2db** and the service to restart **gitea2.service**
I think you get the idea. I can only do so much checking regarding your current setup, but the script should be able to do the logic. Meaning if gitea1 allready exists it will choose gitea2 as the next instance. And since you ventured this far you should know how to fix things if they mess up.
[\[Here\]](https://git.x-files.dk/ubuntu-web-server/nginx-install/src/branch/main/cfg-apps/gitea.443.conf). Also make sure that you correct the /etc/gitea-instance/app.ini to reflect the changes as well i.e change http to https in the app.ini file and then restart Nginx and the Gitea instance.
This is needed in order to change a few configurations in app.ini which is first created when you are done with the setup screen.
cd gitea-install
sudo ./postinstall
### Custom layout
Gitea takes the favicon in form of a svg file and a png file as fallback for browsers that does not support it. A custom logo can also be used. For all 3 files goes the following. They need to be placed in the folowing directory:\
\/var\/lib\/gitea\/custom\/public\/assets\/img\/
Gitea can also serve a splash page instead of the build in one you will need to create a home.tmpl and place it in the following directory:\
Most issues will probably be caused by the fact that we all set up and configure Nginx diffrently. If you encounter problems I would suggest you look at the Nginx configuration I use