title: Unable to put Vapor project with Postgres database on a VPS
body: <p>I'm a newbie with database and Vapor. I'm trying to put a vapor project on a Postgres database on a VPS but I had this error:</p>
  <blockquote>
  <p>2022-08-05 11:18:26.611154+0200 Run[16315:261688] Swift/ErrorType.swift:200: Fatal error: Error raised at top level: PostgresNIO.PSQLError(base: PostgresNIO.PSQLError.Base.connectionError(underlying: NIOPosix.NIOConnectionError(host: &quot;82.125.176.210&quot;, port: 5432, dnsAError: nil, dnsAAAAError: nil, connectionErrors: [NIOPosix.SingleConnectionFailure(target: [IPv4]82.125.176.210/82.125.176.210:5432, error: connection reset (error set): Operation timed out (errno: 60))])))</p>
  </blockquote>
  <p>Here my code:</p>
  <pre class="lang-swift prettyprint-override"><code>import Fluent
  import FluentPostgresDriver
  import Vapor
  import Leaf
  
  public func configure(_ app: Application) throws {
      app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))
          app.middleware.use(app.sessions.middleware)
      let databaseName: String
      let databasePort: Int
      
      databaseName = &quot;vapor_database&quot;
      databasePort = 5432
  
      app.databases.use(.postgres(
      
      hostname: &quot;82.125.176.210&quot;,
      port: databasePort,
      username: Environment.get(&quot;DATABASE_USERNAME&quot;) ?? &quot;456787555&quot;,
      password: Environment.get(&quot;DATABASE_PASSWORD&quot;) ?? &quot;456787555&quot;,
      database: Environment.get(&quot;DATABASE_NAME&quot;) ?? databaseName
    ), as: .psql)
    
      app.migrations.add(CreateUser())
      app.migrations.add(CreateAcronym())
      app.migrations.add(CreateCategory())
  
      app.migrations.add(CreateAcronymCategoryPivot())
      app.migrations.add(CreateToken())
  
      switch app.environment {
      case .development, .testing:
      app.migrations.add(CreateAdminUser())
      default:
      break
      }
      
      app.migrations.add(AddTwitterURLToUser())
  
      
      app.migrations.add(MakeCategoriesUnique())
    
      app.logger.logLevel = .debug
    
      try app.autoMigrate().wait()
  
      app.views.use(.leaf)
    
      // register routes
      try routes(app)
  }
  </code></pre>