Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Gmail SMTP

How to Self-Host Redmine on Ubuntu with Gmail Email Setup

By Freedom251 Team · · 11 min read

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To self-host Redmine on Ubuntu, first pin a Redmine release and its supported Ruby and database versions, then install Redmine from source, configure a least-privilege database account, run the production bundle and migrations, generate Rails’ secret token, and verify the application locally. Add Gmail’s SMTP settings to config/configuration.yml, restart Redmine, and send a test notification before publishing the service behind a TLS-enabled web server.

Choose a compatible stack before installing anything

Redmine’s current installation documentation covers Redmine 6.0 and higher. Start with that release documentation rather than copying an Ubuntu tutorial written for an earlier branch. Record four decisions in your deployment notes:

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • The exact Redmine release, such as the latest maintenance release in the 6.0 series.
  • The Ubuntu release running on the server.
  • The Ruby version supported by that Redmine release.
  • The database engine and supported version, normally PostgreSQL or MySQL.

Redmine’s compatibility matrix ties Ruby, Rails and database support to each Redmine branch. A Ruby package that happens to be available in Ubuntu’s default repositories is not automatically suitable. If the versions do not match, Bundler may fail, native extensions may not compile, or the application may boot with errors that look like database or web-server problems.

Use a dedicated Ubuntu server or virtual machine, a DNS name if the site will be public, SSH access with administrative privileges, and enough storage for uploaded files, logs and database backups. Create a separate operating-system account for the Redmine process instead of running the application as root.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Decide how you will deploy and serve Redmine

Choice Best fit Important trade-off
Manual source installation Administrators who need a current release and control over Ruby, gems and upgrades You own dependency, service and upgrade maintenance
Ubuntu package installation Teams that value distribution-managed files and familiar package updates Packages can lag behind current Redmine releases; paths and service defaults differ from source installs
Puma behind a reverse proxy New deployments using a modern application-server arrangement You must configure the proxy, TLS, headers, process supervision and restart handling
Apache with Passenger Sites already standardized on Apache and Passenger Passenger, Apache modules and the application user must be aligned with the Redmine release

The commands below describe a source deployment. Ubuntu package installations may use paths such as /usr/share/redmine and configuration under /etc/redmine; those paths come from older Ubuntu packaging conventions and should not be assumed for a current source checkout.

Prepare Ubuntu, Ruby and the database

Install build and runtime prerequisites

Update Ubuntu and install the compiler toolchain, Git, the database client development headers, an appropriate JavaScript runtime or asset tool required by your selected Redmine release, and the Ruby version specified by Redmine’s compatibility table. Install Bundler in the manner recommended for that Ruby version. Do not force a newer Ruby merely because it is the newest package in Ubuntu.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo apt update
sudo apt upgrade
sudo apt install git build-essential

The exact package names for database headers and JavaScript tooling vary by Ubuntu release and database choice. Add the PostgreSQL or MySQL client development package that corresponds to the server you selected, then confirm the versions before running Bundler.

Create a least-privilege database and account

Create a database used only by Redmine and an application account that has rights to that database. Do not use the database administrator account in config/database.yml. The following SQL illustrates the principle; choose a long, randomly generated password and store it in your deployment secret store.

CREATE USER redmine_app WITH PASSWORD 'use-a-long-random-secret';
CREATE DATABASE redmine_production OWNER redmine_app;

For MySQL, create the account with privileges limited to the Redmine database and use the character set recommended by your Redmine release. For either engine, restrict network access so the database is not exposed publicly unless your architecture requires it.

Download Redmine and configure the production database

Place the application in a controlled directory

Download the archive or clone the exact Redmine tag you selected, and place it in a stable directory such as /opt/redmine. Keep the release identifier in the directory name or in your deployment notes so an upgrade can be reproduced. The account that runs Redmine should own the application files it must modify, while deployment-only files can remain owned by an administrator.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Edit config/database.yml

Redmine uses this file to select the database adapter gem as well as the connection details. Define the production section; do not accidentally put the settings only under development or test.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
production:
  adapter: postgresql
  database: redmine_production
  host: 127.0.0.1
  username: redmine_app
  password: "use-a-long-random-secret"
  encoding: utf8
  pool: 10

For MySQL, use the mysql2 adapter and the connection values appropriate to your server:

production:
  adapter: mysql2
  database: redmine_production
  host: 127.0.0.1
  username: redmine_app
  password: "use-a-long-random-secret"
  encoding: utf8mb4
  pool: 10
  variables:
    transaction_isolation: "READ-COMMITTED"

Redmine 5.1.1 and later requires READ-COMMITTED transaction isolation for MySQL deployments. Set it explicitly as shown, or verify that the server and connection defaults provide the same isolation. Without it, migrations or normal requests can fail even when the credentials are correct.

Protect this file because it contains a database password. Use restrictive permissions and avoid committing it to a public Git repository.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install production gems and initialize Redmine

Install only the production dependency groups

From the Redmine directory, tell Bundler to omit development and test groups, then install the dependencies. Running Bundler from the Ruby version selected for the Redmine release is essential.

cd /opt/redmine
bundle config set --local without 'development test'
bundle install

If Bundler reports that a gem cannot be built, check the Ruby version, compiler and database development headers before trying random gem versions. Changing a gem by hand can create a combination that the Redmine release does not support.

Generate the Rails secret token

Redmine signs sessions and other application data with a Rails secret. Generate it once for this installation:

bundle exec rake generate_secret_token

Keep the generated secret when restarting or upgrading the same installation. Replacing it unexpectedly can invalidate existing sessions and other signed data.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Run migrations and load the default data

With the database reachable, initialize the production schema and load Redmine’s default data:

RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake redmine:load_default_data

The default-data task asks for a language in interactive installations. If a migration fails, fix the underlying Ruby, adapter or database issue and rerun it; do not skip migrations to make the web process start.

Set writable directories

The Redmine runtime user must be able to write the files, log, tmp and public/assets directories. A typical source deployment uses ownership rather than world-writable permissions:

sudo chown -R redmine:redmine /opt/redmine/files /opt/redmine/log /opt/redmine/tmp /opt/redmine/public/assets
sudo chmod -R u+rwX,go-rwx /opt/redmine/files /opt/redmine/log /opt/redmine/tmp /opt/redmine/public/assets

Replace the user and path with the account and directory used by your service. If uploads fail while pages load, check these four directories first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Perform the local smoke test before exposing Redmine

Run Redmine on loopback while you are still troubleshooting the application itself:

cd /opt/redmine
ruby bin/rails server -e production -b 127.0.0.1 -p 3000

On the server, open http://localhost:3000/ with a text browser or use an SSH tunnel from your workstation. The expected result is the Redmine welcome page. This test separates Rails, Ruby, Bundler and database problems from reverse-proxy, DNS and firewall problems.

Redmine documents the initial credentials as admin and admin. Sign in and change that password immediately, before making the service reachable from a network. Create named administrator accounts for ongoing work and reserve the built-in account for recovery.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Stop the foreground server after the test. For production, supervise the application with your service manager and bind it only to the interface used by the reverse proxy. A typical service command is equivalent to:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
bundle exec rails server -e production -b 127.0.0.1 -p 3000

Use a systemd unit, container supervisor or another process manager to restart the process after a crash and during controlled deployments. Keep the service user, working directory and Ruby environment identical to the one used for the successful smoke test.

Put Redmine behind a web server and TLS

Do not publish the development-style Rails listener directly to the Internet. Place it behind a properly configured web server or reverse proxy that terminates TLS, forwards the original host and protocol, limits request sizes appropriately for attachments, and serves only the intended hostname.

Puma with a reverse proxy

Run Redmine’s application server on loopback and proxy HTTPS requests to it. Configure the proxy’s timeout and upload limits for the size of files your projects use. Forward the HTTPS scheme so Redmine generates secure links and notification URLs correctly. Reload the proxy after validating its configuration, then restart Redmine whenever application configuration changes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Apache and Passenger

Apache with Passenger can integrate Redmine into an existing Apache estate. Older Ubuntu HowTo instructions use /usr/share/redmine, symlink the public directory and restart Apache, but those examples target older package and Redmine branches. Use them only as historical deployment patterns: verify the Passenger-supported Ruby, application path, runtime user and asset permissions against your selected release before applying any command.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Configure Gmail SMTP in Redmine

Use the production section in config/configuration.yml

Redmine’s SMTP settings belong in config/configuration.yml, not in environment.rb. Add them under production:

production:
  delivery_method: :smtp
  smtp_settings:
    enable_starttls_auto: true
    address: "smtp.gmail.com"
    port: 587
    domain: "smtp.gmail.com"
    authentication: :plain
    user_name: "[email protected]"
    password: "your_password"

This is a template, not a real credential. Use the Gmail or Google Workspace account authorized to send the notifications, and store the password or app-specific credential through your deployment’s secret-management process whenever possible. Restrict the configuration file so other local users cannot read it.

In Redmine’s administration interface, set the notification sender address to an address the Gmail account is allowed to use. Gmail may reject mail when the authenticated account is not authorized to send as the configured From address. Account security policies can also require an app-specific credential or another approved authentication method; follow the policy for that Google account rather than repeatedly retrying a blocked password.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Restart after every configuration change

Redmine reads SMTP settings when the application starts. Restart the Redmine service after editing config/configuration.yml; changing the file while an old process is running does not reload the settings. The Redmine installation guide explicitly warns to restart the application after changes to this file.

Google Workspace SMTP relay

Organizations that centralize outbound mail can use smtp-relay.gmail.com on port 587 instead of the account-level Gmail host. Workspace administrators must configure the relay policy, permitted sender addresses, authentication requirements and TLS rules in the Google Admin console. Relay has larger sending limits according to Redmine’s email-configuration documentation, but it is not a drop-in replacement: a policy mismatch produces authentication or relay-denied errors even when the Redmine YAML is syntactically correct.

Send and verify a real notification

  1. Confirm the application is running the production environment and that the restarted process has the new configuration.
  2. In Redmine administration, verify the sender address and enable email notifications for a test user.
  3. Create a small test project or issue and perform an action that should notify the test account.
  4. Watch the Redmine production log while sending. Look for an SMTP connection, authentication result and final delivery response.
  5. Check the recipient’s inbox and spam folder, then inspect Gmail or Workspace mail logs if the message left Redmine but did not arrive.

A successful SMTP connection proves that Redmine handed the message to Google; it does not guarantee inbox placement. Domain authentication, recipient filtering and organizational policies can still affect delivery.

Troubleshoot the failures that occur most often

Redmine will not boot after installation

  • Compare the running Ruby version with the exact Redmine release compatibility table.
  • Run bundle install again from the same Ruby environment used by the service.
  • Check that the production database adapter in database.yml matches the selected engine and that its client headers were installed.
  • Read the first exception in the production log rather than the final web-server error, which is often only a proxy symptom.

The database connection or migration fails on MySQL

Verify hostname, database name, account privileges and password first. On Redmine 5.1.1 and later, confirm that the connection uses READ-COMMITTED transaction isolation. A server-wide default may not apply to the Redmine connection, so the variables block in database.yml is the safer explicit setting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pages load but no email is sent

  • Confirm the SMTP block is under production in config/configuration.yml.
  • Use smtp.gmail.com, port 587, STARTTLS and plain authentication for direct Gmail SMTP.
  • Check that the username, credential and From address are authorized by Gmail or Workspace.
  • Restart Redmine after every edit.
  • Check the production log for DNS, timeout, TLS and authentication errors separately.

Google reports authentication or relay denial

For direct Gmail, verify that the account is permitted to use SMTP and that its security policy accepts the credential type. For Workspace relay, ask an administrator to verify the source IP or authentication rule, allowed sender domains, TLS requirement and relay scope. Switching hosts without correcting the policy will not solve the denial.

Uploads, assets or logs fail with permission errors

Ensure the runtime user owns files, log, tmp and public/assets, and that the reverse proxy is not pointing at a different checkout. Avoid making the entire application world-writable; fix ownership on the directories that need runtime writes.

The public site fails while localhost works

Return to the local Puma smoke test. If it succeeds, inspect the reverse proxy’s upstream address, TLS certificate, forwarded headers, firewall and DNS. This staged approach prevents you from debugging two independent layers at once.

Operate and upgrade the installation safely

  • Back up the Redmine database and the files directory; attachments are not contained in the database backup.
  • Keep config/database.yml, config/configuration.yml and the generated secret outside public source control.
  • Record the Redmine, Ruby, Rails, Bundler, database and operating-system versions before each upgrade.
  • Test a new Redmine release on a staging copy, run migrations there, and verify SMTP before changing production.
  • Schedule a maintenance window for migrations and restart both the application and any process manager that caches the old Ruby environment.
  • Monitor disk space, log growth, database availability, certificate expiry and failed notification rates.

When moving between major Redmine branches, read that branch’s installation and upgrade instructions rather than assuming that an existing bundle or database schema can be reused unchanged.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which combination should you choose?

Decision Choose this when Watch for
PostgreSQL Your team already operates PostgreSQL and has compatible backup and monitoring tools Use the adapter and server version listed for your Redmine release
MySQL MySQL is the established platform in your organization Redmine 5.1.1 and later requires READ-COMMITTED isolation
Direct Gmail SMTP A single project or small installation needs straightforward account-level sending Sender authorization, account security policy and per-account limits apply
Google Workspace relay An organization centrally manages senders or needs larger relay limits Relay policy, authentication, TLS and allowed senders must all match
Source install with Puma You want a current Redmine release and control over the runtime You maintain Ruby, gems, service supervision and reverse-proxy configuration
Distribution package with Apache/Passenger Your operations team standardizes on Ubuntu packages and Apache Package versions and filesystem paths may reflect older Redmine branches

The reliable sequence is consistent: match versions first, configure the database, install and initialize Redmine, verify it on localhost, publish it through a secured web server, then configure and test Gmail SMTP. Keeping those stages separate makes failures diagnosable and prevents an email or proxy problem from hiding a broken application install.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Gmail SMTPGoogle WorkspaceMySQLPostgreSQLRedmineRuby on Railsself-hostingUbuntu

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.