1 ### Install build requirements
4 sudo apt install git cargo libssl-dev pkg-config libpq-dev yarn curl gnupg2 espeak
6 curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
7 echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
8 sudo apt update && sudo apt install yarn
13 Install Rust using [the recommended option on rust-lang.org](https://www.rust-lang.org/tools/install) (rustup).
15 Then, install [Homebrew](https://brew.sh/) if you don't already have it installed.
17 Finally, install Node and Yarn.
20 brew install node yarn
23 ### Get the back end source code
25 git clone https://github.com/LemmyNet/lemmy.git
26 # or alternatively from gitea
27 # git clone https://yerbamate.dev/LemmyNet/lemmy.git
30 ### Build the backend (Rust)
33 # for development, use `cargo check` instead)
36 ### Get the front end source code
38 git clone https://github.com/LemmyNet/lemmy-ui.git
39 # get the translations
41 git submodule update --remote
47 sudo apt install postgresql
48 sudo systemctl start postgresql
50 # Either execute db-init.sh, or manually initialize the postgres database:
51 sudo -u postgres psql -c "create user lemmy with password 'password' superuser;" -U postgres
52 sudo -u postgres psql -c 'create database lemmy with owner lemmy;' -U postgres
53 export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy
58 brew install postgresql
59 brew services start postgresql
60 /usr/local/opt/postgres/bin/createuser -s postgres
62 # Either execute db-init.sh, or manually initialize the postgres database:
63 psql -c "create user lemmy with password 'password' superuser;" -U postgres
64 psql -c 'create database lemmy with owner lemmy;' -U postgres
65 export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy
68 ### Run a local development instance
74 Then open [localhost:1235](http://localhost:1235) in your browser. To reload back-end changes, you will have to rerun `cargo run`. You can use `cargo check` as a faster way to find compilation errors.
76 To do front end development:
84 and go to [localhost:1234](http://localhost:1234). Front end saves should rebuild the project.
86 Note that this setup doesn't include image uploads or link previews (provided by pict-rs and
87 iframely respectively). If you want to test those, you should use the
88 [Docker development](contributing_docker_development.md).