Skip to content

Connect to Production Console

🚀 How to Connect to Mobayilo Production Console

Section titled “🚀 How to Connect to Mobayilo Production Console”

Production is hosted on Dokploy. The database runs as a Docker service on the same VPS.


Connect directly to the Postgres container running on the Dokploy server.

Terminal window
ssh <user>@<your-dokploy-server-ip>
Terminal window
docker ps --filter "name=postgres" --format "table {{.Names}}\t{{.Status}}"
Terminal window
docker exec -it <postgres_container_name> psql -U <db_user> -d <db_name>

Tip: If you don’t know the database name or user, check the environment variables in the Dokploy dashboard for the Mobayilo app service.

If you need the Rails console instead of raw SQL, SSH into the server and run:

Terminal window
docker exec -it <mobayilo_app_container_name> bin/rails console

If you have exposed the Postgres port publicly (or are using an external managed database), connect directly from your local machine:

Terminal window
psql "postgresql://<USER>:<PASSWORD>@<HOST>:<PORT>/<DB_NAME>"

Or run the Rails console locally with the production URL:

Terminal window
RAILS_ENV=production DATABASE_URL="postgresql://<USER>:<PASSWORD>@<HOST>:<PORT>/<DB_NAME>" bin/rails console

Then force the connection:

ActiveRecord::Base.establish_connection("postgresql://<USER>:<PASSWORD>@<HOST>:<PORT>/<DB_NAME>")

Now that you are connected, here is how to handle your admin user:

# This finds the user if they exist, or starts a new one if they don't
admin = AdminUser.find_or_initialize_by(email: 'admin@example.com')
# Set/Reset the password
admin.password = '<SET_A_SECURE_PASSWORD>'
admin.password_confirmation = '<SET_A_SECURE_PASSWORD>'
# Save to the live database
admin.save!

Important: Never place real credentials in docs. Use placeholders like the above.

# Count total admins
AdminUser.count
# List the last 5 users to join
User.order(created_at: :desc).limit(5)
# Check a specific account balance
Account.find_by(name: "Some Account").balance