You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide will help you install and setup PostgreSQL for hosting the database locally.
13
+
14
+
## Windows
15
+
:::caution[]
16
+
**Windows is not supported for firmware and ground station development.**
17
+
18
+
If you are using Windows, you will need to install Windows Subsystem for Linux (WSL). WSL lets you run a complete Linux environment directly inside Windows without virtual machine overhead or dual booting.
19
+
20
+
Make sure you follow the [Initial setup](/OBC-firmware/start-here/initial-setup) guide.
21
+
:::
22
+
23
+
## Linux/WSL
24
+
25
+
<Steps>
26
+
1. Open a terminal and run the following commands to install PostgreSQL:
27
+
28
+
```shell
29
+
sudo apt update
30
+
sudo apt install postgresql-16
31
+
```
32
+
33
+
2. Run `sudo -u postgres psql --version` to ensure PostgreSQL was installed properly. It should print that the major version is 16.
34
+
35
+
3. Run the following commands to setup PostgreSQL for the ground station:
36
+
37
+
```shell
38
+
# Connect to PostgreSQL CLI as the postgres superuser
39
+
sudo -u postgres psql
40
+
# Replace 'your_username' and 'your_password' with your desired values
41
+
CREATE USER your_username WITH PASSWORD 'your_password' SUPERUSER;
42
+
CREATE DATABASE gs
43
+
```
44
+
45
+
4. Log out, then verify that you can log in to your newly created user and database:
46
+
47
+
```shell
48
+
\q# Log out
49
+
# Replace 'your_username' with your actual username
50
+
psql -U your_username -d gs
51
+
# You should be logged into the database
52
+
\q# Log out again
53
+
54
+
5. From the root directory, run the following commands to create a new .env file:
55
+
56
+
```shell
57
+
cd gs/backend/config
58
+
cp template.env .env
59
+
```
60
+
61
+
6. Edit the new .env file to add your login details in the quotes. In Linux/WSL, you can use `vim` or `nano`.
0 commit comments