- Strapi Version: 4.5.5
- Operating System: Ubuntu 22.04
- Database: PostgreSQL 8.6.0
- Node Version: 18.13.0
- NPM Version: 8.19.3
I can’t use a standard pure VPS to run strapi. After all the actions, the panel on the server becomes available to me, but when I enter the login and password, I see “an error occurred”. There are no error messages in the console.
Here is my complete procedure:
I created my strapi application based on PostgreSQL and created some data types and the data itself. React is used to process data. Everything worked great. I uploaded the React App and the Strapi App on GitHub.
I then set up a VPS server, uploaded my React and Strapi apps from GitHub to the VPS server. I installed nginx. I created a database, which I named the same as on the local computer. Checked that the database is new and empty. Next, I made a copy of the database on the local computer, uploaded it to the server and imported it into postgreSQL. After that, this data actually appeared in the database. Everything is fine.
I then copied everything from the .env file located on the strapi project’s local machine to the starpi folder on the VPS.
Then in the strapi folder: npm i → npm run start.
After that, the authorization window became available to me, but after entering the login / password, I saw an error window. There were no errors in the console. In the “Network” tab, I searched for requests and found one with a strange response.
Requests in order:
/admin/project-type - ok.
/admin/init - ok
/admin/telemetry-properties - 401 Unauthorized
Next, I enter the login-password, after which I see the answers:
/admin/login - ok. Came token
https://api.github.com/repos/strapi/strapi/releases/latest - ok
/admin/info - ok
/admin/users/me/permissions - ok
/admin/users/me - ok
There are no more requests.
I hope we can solve the problem together and it will help someone else in the future.