Cannot access Gitea over network after setup

I can successfully setup Gitea by 192.168.1.153:3000 … but after Initial Configuration the login page will not display here: 192.168.1.153:3000/user/login

To retry the install, I do this:
sudo rm /etc/gitea/app.ini
sudo systemctl restart gitea
And access 192.168.1.153:3000 again

Do you know what it could be? I’m on Debian 11 and there is no firewall. I do have Webmin working from that server at https://192.168.1.153:10000/

Here is my app.ini:

APP_NAME = Gitea: Dub20
RUN_USER = git
RUN_MODE = prod

[database]
DB_TYPE  = mysql
HOST     = 127.0.0.1:3306
NAME     = gitea
USER     = gitea
PASSWD   = wor...
SCHEMA   = 
SSL_MODE = disable
CHARSET  = utf8
PATH     = /var/lib/gitea/data/gitea.db
LOG_SQL  = false

[repository]
ROOT = /var/lib/gitea/data/gitea-repositories

[server]
SSH_DOMAIN       = localhost
DOMAIN           = localhost
HTTP_PORT        = 3000
ROOT_URL         = http://localhost:3000/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = true
LFS_JWT_SECRET   = wpt...
OFFLINE_MODE     = false

[lfs]
PATH = /var/lib/gitea/data/lfs

[mailer]
ENABLED = false

[service]
REGISTER_EMAIL_CONFIRM            = false
ENABLE_NOTIFY_MAIL                = false
DISABLE_REGISTRATION              = false
ALLOW_ONLY_EXTERNAL_REGISTRATION  = false
ENABLE_CAPTCHA                    = false
REQUIRE_SIGNIN_VIEW               = false
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreply.localhost

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

[cron.update_checker]
ENABLED = false

[session]
PROVIDER = file

[log]
MODE      = console
LEVEL     = info
ROOT_PATH = /var/lib/gitea/log
ROUTER    = console

[repository.pull-request]
DEFAULT_MERGE_STYLE = merge

[repository.signing]
DEFAULT_TRUST_MODEL = committer

[security]
INSTALL_LOCK       = true
INTERNAL_TOKEN     = eyJ...
PASSWORD_HASH_ALGO = pbk...

but after Initial Configuration the login page will not display here: 192.168.1.153:3000/user/login

What do you mean by this? Are you able to access other pages, are you getting a timeout error, are you getting a cannot connect to server error?

I suspect there is an issue with file permissions or database which is preventing Gitea from starting. Run through initial configuration steps. When you are experiencing error, run sudo journalctl -b -u gitea to see what Gitea is saying (if lots of logs press Ctrl+V to page down to latest).

If you are not sure how to solve error, run sudo journalctl -b -u gitea > logfile.txt and upload logfile for us to investigate.

Hi thanks, yes, cannot connect to server. I see now that Gitea isn’t running. The logfile shows something about the git user file permissions. I tried but cannot fix it, error showing at bottom.

Mar 26 22:16:00 dub20 systemd[1]: Started Gitea (Git with a cup of tea).
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 cmd/web.go:105:runWeb() [I] Starting Gitea on PID: 1913129
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 cmd/web.go:159:runWeb() [I] Global init
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:118:GlobalInitInstalled() [I] Git Version: 2.30.2, Wire Protocol Version 2 Enabled (home: /var/lib/gitea/data/home)
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:119:GlobalInitInstalled() [I] AppPath: /usr/local/bin/gitea
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:120:GlobalInitInstalled() [I] AppWorkPath: /var/lib/gitea
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:121:GlobalInitInstalled() [I] Custom path: /var/lib/gitea/custom
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:122:GlobalInitInstalled() [I] Log path: /var/lib/gitea/log
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:123:GlobalInitInstalled() [I] Configuration file: /etc/gitea/app.ini
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:124:GlobalInitInstalled() [I] Run Mode: Prod
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:125:GlobalInitInstalled() [I] Gitea v1.19.0-rc0 built with GNU Make 4.1, go1.20.1 : bindata, sqlite, sqlite_unlock_notify
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...dules/setting/log.go:331:initLogFrom() [I] Gitea Log Mode: Console(Console:info)
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...dules/setting/log.go:286:generateNamedLogger() [I] Router Log: Console(console:info)
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:175:initAttachments() [I] Initialising Attachment storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/attachments
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:165:initAvatars() [I] Initialising Avatar storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/avatars
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:191:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/repo-avatars
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:185:initLFS() [I] Initialising LFS storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/lfs
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:197:initRepoArchives() [I] Initialising Repository Archive storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/repo-archive
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:207:initPackages() [I] Initialising Packages storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/packages
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:143:GlobalInitInstalled() [I] SQLite3 support is enabled
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/common/db.go:21:InitDBEngine() [I] Beginning ORM engine initialization.
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #1/10...
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 cmd/web.go:163:runWeb() [I] PING DATABASE mysql
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:148:GlobalInitInstalled() [W] Table system_setting Column version db default is , struct default is 1
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:148:GlobalInitInstalled() [W] Table project column board_type db type is INT(10) UNSIGNED, struct type is INT UNSIGNED
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:148:GlobalInitInstalled() [W] Table project column card_type db type is INT(10) UNSIGNED, struct type is INT UNSIGNED
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:148:GlobalInitInstalled() [W] Table project column type db type is INT(10) UNSIGNED, struct type is INT UNSIGNED
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:149:GlobalInitInstalled() [I] ORM engine initialization successful!
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...xer/stats/indexer.go:38:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...er/issues/indexer.go:173:func2() [I] [6420fc60-26] PID 1913129: Initializing Issue Indexer: bleve
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:89:syncAppConfForGit() [I] AppPath changed from '' to '/usr/local/bin/gitea'
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:94:syncAppConfForGit() [I] CustomConf changed from '' to '/etc/gitea/app.ini'
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:100:syncAppConfForGit() [I] re-sync repository hooks ...
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:103:syncAppConfForGit() [I] re-write ssh public keys ...
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...y_authorized_keys.go:136:RewriteAllPublicKeys() [E] Unable to MkdirAll(/home/git/.ssh): mkdir /home/git: permission denied
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:61:mustInit() [F] code.gitea.io/gitea/models/asymkey.RewriteAllPublicKeys failed: mkdir /home/git: permission denied
Mar 26 22:16:00 dub20 systemd[1]: gitea.service: Main process exited, code=exited, status=1/FAILURE
Mar 26 22:16:00 dub20 systemd[1]: gitea.service: Failed with result 'exit-code'.
Mar 26 22:16:00 dub20 systemd[1]: Started Gitea (Git with a cup of tea).
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 cmd/web.go:105:runWeb() [I] Starting Gitea on PID: 1913129
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 cmd/web.go:159:runWeb() [I] Global init
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:118:GlobalInitInstalled() [I] Git Version: 2.30.2, Wire Protocol Version 2 Enabled (home: /var/lib/gitea/data/home)
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:119:GlobalInitInstalled() [I] AppPath: /usr/local/bin/gitea
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:120:GlobalInitInstalled() [I] AppWorkPath: /var/lib/gitea
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:121:GlobalInitInstalled() [I] Custom path: /var/lib/gitea/custom
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:122:GlobalInitInstalled() [I] Log path: /var/lib/gitea/log
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:123:GlobalInitInstalled() [I] Configuration file: /etc/gitea/app.ini
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:124:GlobalInitInstalled() [I] Run Mode: Prod
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:125:GlobalInitInstalled() [I] Gitea v1.19.0-rc0 built with GNU Make 4.1, go1.20.1 : bindata, sqlite, sqlite_unlock_notify
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...dules/setting/log.go:331:initLogFrom() [I] Gitea Log Mode: Console(Console:info)
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...dules/setting/log.go:286:generateNamedLogger() [I] Router Log: Console(console:info)
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:175:initAttachments() [I] Initialising Attachment storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/attachments
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:165:initAvatars() [I] Initialising Avatar storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/avatars
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:191:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/repo-avatars
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:185:initLFS() [I] Initialising LFS storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/lfs
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:197:initRepoArchives() [I] Initialising Repository Archive storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/repo-archive
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...s/storage/storage.go:207:initPackages() [I] Initialising Packages storage with type:
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...les/storage/local.go:45:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/packages
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:143:GlobalInitInstalled() [I] SQLite3 support is enabled
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/common/db.go:21:InitDBEngine() [I] Beginning ORM engine initialization.
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #1/10...
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 cmd/web.go:163:runWeb() [I] PING DATABASE mysql
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:148:GlobalInitInstalled() [W] Table system_setting Column version db default is , struct default is 1
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:148:GlobalInitInstalled() [W] Table project column board_type db type is INT(10) UNSIGNED, struct type is INT UNSIGNED
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:148:GlobalInitInstalled() [W] Table project column card_type db type is INT(10) UNSIGNED, struct type is INT UNSIGNED
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:148:GlobalInitInstalled() [W] Table project column type db type is INT(10) UNSIGNED, struct type is INT UNSIGNED
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:149:GlobalInitInstalled() [I] ORM engine initialization successful!
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...xer/stats/indexer.go:38:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...er/issues/indexer.go:173:func2() [I] [6420fc60-26] PID 1913129: Initializing Issue Indexer: bleve
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:89:syncAppConfForGit() [I] AppPath changed from '' to '/usr/local/bin/gitea'
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:94:syncAppConfForGit() [I] CustomConf changed from '' to '/etc/gitea/app.ini'
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:100:syncAppConfForGit() [I] re-sync repository hooks ...
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:103:syncAppConfForGit() [I] re-write ssh public keys ...
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 ...y_authorized_keys.go:136:RewriteAllPublicKeys() [E] Unable to MkdirAll(/home/git/.ssh): mkdir /home/git: permission denied
Mar 26 22:16:00 dub20 gitea[1913129]: 2023/03/26 22:16:00 routers/init.go:61:mustInit() [F] code.gitea.io/gitea/models/asymkey.RewriteAllPublicKeys failed: mkdir /home/git: permission denied
Mar 26 22:16:00 dub20 systemd[1]: gitea.service: Main process exited, code=exited, status=1/FAILURE
Mar 26 22:16:00 dub20 systemd[1]: gitea.service: Failed with result 'exit-code'.

It works now, I added /home/git and set the owner to git.

Perfect. Glad you got it working!

I get the same problem: Initial Configuration successfully , but the login page can’t display.
the difference is: no any files in the log directory
I guess is also permission problem, but what should I do ??

OK, I’m also working now, but a pic file can not get, url is: https://secure.gravatar.com/avatar/63acf24f7a616ffc2ee0b9cb8708098e?d=identicon&s=112