--- title: Postgres Database emoji: 🐘 colorFrom: blue colorTo: indigo sdk: docker app_port: 7860 pinned: false --- # n8n + PostgreSQL on Hugging Face Spaces This Space runs **n8n** (Workflow Automation) and **PostgreSQL** together in a single container. - **n8n**: Accessible via the Space URL (Port 7860). - **PostgreSQL**: Running internally on Port 5432. ## ⚠️ Note: Ephemeral Storage You have chosen to use the container's built-in storage. **Warning**: This storage is **ephemeral**. - If the Space restarts (which happens after 48 hours of inactivity or during updates), **ALL DATA (Workflows + DB)** will be lost. - This setup is suitable for testing, demos, or temporary data. ## Getting Started 1. Wait for the Space to build. 2. Open the Space URL. 3. Set up your n8n owner account. 4. To connect to the database in n8n, use: - **Host**: `localhost` - **Port**: `5432` - **Database**: `app_db` - **User**: `app_user` - **Password**: `app_password` ## Sample Workflow A sample workflow file `workflow.json` is included in the files. You can import it to test the connection.