Skip to content

Commit

Permalink
Added post-installation WSL2 steps
Browse files Browse the repository at this point in the history
  • Loading branch information
martinovicdev committed Jan 16, 2025
1 parent c306684 commit d008fa2
Showing 1 changed file with 41 additions and 6 deletions.
47 changes: 41 additions & 6 deletions blog/src/content/docs/start/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Your version of Node.js must be >= 18.
To switch easily between Node.js versions, we recommend using [nvm](https://github.com/nvm-sh/nvm).

:::note[Installing and using nvm]

<details>
<summary>
Need help with nvm?
Expand Down Expand Up @@ -54,7 +55,6 @@ Check NVM repo for more details: https://github.com/nvm-sh/nvm.
</details>
:::


### Linux and macOS

Open your terminal and run:
Expand All @@ -64,6 +64,7 @@ curl -sSL https://get.wasp-lang.dev/installer.sh | sh
```

:::caution[Bad CPU type in executable]

<details>
<summary>
Are you getting this error on a Mac (Apple Silicon)?
Expand All @@ -73,30 +74,62 @@ Given that the wasp binary is built for x86 and not for arm64 (Apple Silicon), y
```bash
softwareupdate --install-rosetta
```

Once Rosetta is installed, you should be able to run Wasp without any issues.
:::

</details>

### Windows

In order to use Wasp on Windows, you need to install WSL2 (Windows Subsystem for Linux) and a Linux distribution of your choice. We recommend using Ubuntu.
In order to use Wasp on Windows, you need to install WSL2 (Windows Subsystem for Linux) and a Linux distribution of your choice. We recommend using Ubuntu.

**You can refer to this [article](https://wasp-lang.dev/blog/2023/11/21/guide-windows-development-wasp-wsl) for a step by step guide to using Wasp in the WSL environment.** If you need further help, reach out to us on [Discord](https://discord.gg/rzdnErX).

Once in WSL2, run the following command in your **WSL2 environment**:
:::caution[WSL2 Docker post installation steps]

<details>
<summary>
Complete those steps to ensure that PostgreSQL and Docker work correctly with Wasp in WSL2.
</summary>
It is recommended to complete those post-install steps in WSL, based on the official <a href="https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user">Docker</a> guide. These work if you are experiencing an error similar to <a href="https://github.com/wasp-lang/open-saas/issues/347">this</a> one.

First, run

```bash
sudo groupadd docker
```

command to create the `docker` group in case it doesn't exist. If it exists, don't worry, just continue with next steps. After that, add your current user to docker group by running

```bash
sudo usermod -aG docker $USER
```

where $USER is your username. After that, log out and log back in to apply the changes. Finally, run

```bash
su -s $USER
```

</details>
:::

Once done, in WSL2 run the following command in your **WSL2 environment**:

```sh
curl -sSL https://get.wasp-lang.dev/installer.sh | sh
```

:::caution[WSL2 and file system issues]

<details>
<summary>
Are you getting file system issues using WSL2?
</summary>
If you are using WSL2, make sure that your Wasp project is not on the Windows file system, <b>but instead on the Linux file system</b>. Otherwise, Wasp won't be able to detect file changes, due to this <a href='https://github.com/microsoft/WSL/issues/4739'>issue in WSL2</a>.
</details>
:::
:::

### Finalize Installation

Expand All @@ -117,6 +150,7 @@ You can install the Wasp VSCode extension by searching for "Wasp" in the Extensi
### Cloning the OpenSaaS template

From the directory where you'd like to create your new project run:

```sh
wasp new
```
Expand Down Expand Up @@ -187,8 +221,9 @@ This will install all the dependencies and start the app (client and server) for
If the app doesn't open automatically in your browser, you can open it manually by visiting `http://localhost:3000` in your browser.

At this point, you should have:
- your database running in one terminal session, likely on port `5432`.
- your app running in another terminal session, the client likely on port `3000`, and the server likely on port `3001`.

- your database running in one terminal session, likely on port `5432`.
- your app running in another terminal session, the client likely on port `3000`, and the server likely on port `3001`.

#### Run Blog and Docs

Expand Down

0 comments on commit d008fa2

Please sign in to comment.