Selfhosting
This guide will help you set up and run your own instance of FMHY locally.
WARNING
Do note that you must differentiate your instance from the official site (fmhy.net) to avoid confusion. Steps to do so are given below.
Prerequisites
Docker (Experimental)
You will need to install Docker and Docker Compose run your own instance of FMHY locally.
After installing Docker and Docker Compose, run the following commands:
git clone https://github.com/fmhy/edit.git
cd edit
sudo docker compose up --buildIt should take a few minutes to build the image and start the container, running at port 4173.
Manually
- Git
- Node.js - Use the latest available LTS, doesn't matter much
- pnpm 9.12.2 or newer
Step 1: Clone the Repository
git clone https://github.com/fmhy/edit.git
cd editStep 2: Install Dependencies
Install project dependencies using pnpm:
pnpm installStep 3: Development Mode
To run the project in development mode:
# Start the documentation site in dev mode
pnpm docs:dev
# Start the API in dev mode (if needed)
pnpm api:devThe development server will start at http://localhost:5173 by default.
Step 4: Building for Production
You will need to update:
- the
metaconstant indocs/.vitepress/constants.tsname: Name of your instancehostname: Your domaindescription: Description of your instancetags: Opengraph tagsbuild: Build options (can be configured with Environment Variables)
docs/index.mdtitledescriptionhero.namehero.tagline
To build the project for production:
# Build the documentation site
pnpm docs:build
# Build the API (if needed) using the Node.js preset
NITRO_PRESET=node pnpm api:buildStep 5: Preview Production Build
To preview the production build locally:
# Preview the documentation site
pnpm docs:preview
# Preview the API (if needed)
pnpm api:previewStep 6: Deploy
See the VitePress deployment guide for more information.
Environment Variables
You may want to disable NSFW content (sidebar entry, page contents) and/or the API component for Feedback:
FMHY_BUILD_NSFW- Disables NSFW content (experimental)FMHY_BUILD_API- Disables the API component
Troubleshooting
- If you encounter Node.js version issues, ensure you're using Node.js 21+
- For pnpm-related issues, make sure you're using pnpm 9+
- Clear the cache if you encounter build issues:bash
rm -rf docs/.vitepress/cache rm -rf docs/.vitepress/dist pnpm install