Serverpod as a localhost server on windows

542 Views Asked by At

I want to deploy Serverpod as a localhost server on windows without using docker.

i don't want to use docker on client machine, and is serverpod stable on windows?

2

There are 2 best solutions below

0
On

I would recommend to use docker as it makes everything much easier, do you have any specific reason for not running docker on your dev machine?


With that said yes it is possible to run without docker!

When creating a new project you can add the flag -f to force create the project, this way the tool will ignore that you do not have docker installed. I.E. run:

$ serverpod create -f my_project

Then you will have to manually install postgres and redis on your machine, you can find them here https://www.postgresql.org/download/ and here https://redis.io/download/.

Redis is actually not used by default in a clean project, but there are some features tied to it such as caching and communication between multiple server instances. In other words it is optional to just get things running but probably a good idea to configure it anyway.

After you have downloaded the software you have to start the services. Then you need to configure both postgresql and redis to use the correct connection details. It is also possible to configure the serverpod connection details.

If you want to change any defaults you can configure the serverpod connection details in this file: project_name_server/config/development.yaml

development.yaml config file

The passwords are configured in this file: project_name_server/config/passwords.yaml

enter image description here

Now you create a database either with the default values, or with your own and then update the config files linked above. Do the same for redis if you set it up.

With everything configured and running you should be able to start the serverpod server by running dart bin/main.dart.

0
On

At this point serverpod not officially supported on windows. But it works fine in windows. They recommended to use docker because Databases run on top of docker containers. Watch this for more info https://youtu.be/BQ6JQbp2Xy0