y comes in two parts: a server and web distribution.
You can download the latest version of y on the releases page.
In order to set up y on your server, you will first need:
- A linux machine.
- PostgreSQL (version 16.0 or higher).
- A web server (nginx/apache/etc.).
"Storage" feature optional dependencies:
imagemagick
- thumbnail generation for image files.ffmpeg
- thumbnail generation for video files.
After installing postgresql and initializing your database cluster (see postgresql documentation), do the following:
- Launch
psql
(you might need to log in as thepostgres
user first -sudo su - postgres
) - Create a database for y:
CREATE DATABASE y;
- Create a user:
CREATE USER y_user WITH PASSWORD 'passw0rd!';
- Grant required privileges to that user:
GRANT ALL PRIVILEGES ON DATABASE "y" to y_user;
- Set that user as the owner of the database:
ALTER DATABASE y OWNER TO y_user;
y server is, for the most part, just one binary file. You can either run it from a cli, if you want to test it out first, or set up a service for it, which is a more long-term soultion.
Before starting the server, edit the .env
file and update it according to your setup. You mainly want to make sure that the DATABASE_URL
variable is correct, everything else should be fine by default. Then,
- to start the server from a cli, just run
./y-server
, or - to set up y-server as a service, run the
./install.sh
script.
y server does not serve y's web files, so you will have to use a web server for that.
The next section is written for nginx, but you can use any web server you like.
- Install nginx.
- Copy y's
www
folder anywhere you like, those files will be hosted by nginx. - Add the following configuration to your
/etc/nginx/nginx.conf
:
server {
# Example server config:
server_name localhost;
listen 80;
# Replace with the path to your www folder:
root /usr/share/nginx/y/www;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
}
}
Don't forget to restart nginx after updating ninx.conf
.
If you've done everything correctly, you should be able to open y in your browser and log into a default admin user:
- username:
admin
- password:
admin
Setting up a development environment should be very straightforward.
-
Install PostgreSQL and set it up using a tutorial in the "Installing y (production environment)" section.
-
Install NodeJS, pnpm and Rust.
-
Clone the repo:
git clone https://github.com/sk-m/y.git
-
Start the server:
cd y/y-server
cp .env.example .env
- update
.env
according to your setup cargo run
-
Start up the frontend:
cd y/y-web
pnpm install
pnpm run dev