Join us on March 29th for Developer Days!Learn More

Connect from Symfony with Doctrine to Neon

Set up a Neon project in seconds and connect from Symfony with Doctrine

Symfony is a free and open-source PHP web application framework. Symfony uses the Doctrine library for database access. Connecting to Neon from Symfony with Doctrine is the same as connecting to a standalone PostgreSQL installation from Symfony with Doctrine. Only the connection details differ.

To connect to Neon from Symfony with Doctrine:

  1. Create a Neon Project
  2. Configure the connection

Create a Neon project

If you do not have one already, create a Neon project. Save your connection details including your password. They are required when defining connection settings.

  1. Navigate to the Projects page in the Neon Console.
  2. Click New Project.
  3. Specify a name, a PostgreSQL version, a region, and click Create Project.

Configure the connection

In your .env file, set the DATABASE_URL to the Neon project connection string that you copied in the previous step.



  • <user> is the database user.
  • <password> is the database user's password, which is provided to you when you create a Neon project.
  • <hostname> the hostname of the branch's compute endpoint. The hostname has an ep- prefix and appears similar to this:
  • <dbname> is the name of the database. The default Neon database is neondb

You can find all of the connection details listed above, except for your password, in the Connection Details widget on the Neon Dashboard. For more information, see [Connect from any application]/docs/connect/connect-from-any-app). If you have misplaced your password, see Reset a password.

Need help?

Send a request to, or join the Neon community forum.

Edit this page
Was this page helpful?