Urgent.News

What's breaking now, across thousands of outlets.

Tech

What I Check Before Deploying a Website to Production

What I Check Before Deploying a Website to Production Deploying a website can feel like the finish line. The code works. The pages look right. The buttons respond. The tests are passing. Then you deploy it and discover that something important was missed. Maybe an environment variable wasn't configured. Maybe the production database is using the wrong connection. Maybe a redirect is broken. Or…

Deploying a website to production can often feel like crossing the finish line. After confirming that the code functions correctly, the pages display properly, and the buttons respond as expected, it's easy to overlook potential issues that may arise during the deployment process. To prevent unnecessary problems, a simple pre-deployment checklist is essential. Here are some critical checks to perform before pushing a website into production:

1. Check Environment Variables: Never assume the production environment is identical to your local machine. Ensure that crucial elements like DATABASE_URL, API_KEY, APP_URL, NODE_ENV, and SECRET_KEY are properly configured. Keep sensitive credentials out of the Git repository by storing them in environment files and excluding them using .gitignore.

2. Test the Production Build: Local development environments might hide problems. For instance, a JavaScript application might work fine when using npm run dev but fail during the production build. Run the actual build process locally and test the generated application as closely as possible to the production environment. This can help uncover issues like missing dependencies, invalid imports, or build configuration problems.

3. Check Database Changes: Database migrations require extra attention. Ensure that any new columns, tables, indexes, or constraints are included in the deployment process. Consider the possibility of a short period where old application code and new database structures interact, requiring a thoughtful migration strategy.

4. Don't Forget Error Handling: Users should not see raw exceptions or database errors. Instead, provide a user-friendly response while logging the technical details internally. For example, instead of displaying an SQL error message, show a generic "Something went wrong. Please try again in a few moments." Maintain clear logging for developers to diagnose the problem effectively.

5. Check Logs: Verification isn't complete until the logs are inspected. Check the logs for repeated errors, database connection failures, authentication issues, missing environment variables, timeout errors, or unexpected HTTP status codes. This step confirms that users will have a smooth experience after deployment.

6. Test Important User Flows: Instead of testing every tiny detail manually, focus on critical user flows that could cause significant problems if they stop working. For example, test the homepage, login, dashboard, create an item, save changes, and logout sequence for an e-commerce website, or the product, cart, checkout, payment, and confirmation flow for an online store. These critical paths deserve extra attention after deployment.

7. Check HTTPS: Ensure the production website uses HTTPS. Open the website manually and verify that https://example.com is loading correctly. Test the HTTP version (http://example.com) to confirm that it correctly redirects to HTTPS. Check for mixed-content problems where an HTTPS page attempts to load insecure HTTP resources, which may lead to browser blocks or security warnings.

8. Check DNS: DNS problems can make a perfectly deployed website appear broken. Verify all necessary DNS records (A, AAAA, CNAME, MX, TXT) before or immediately after deployment. For example, if you are moving a website to a new server, the domain might still point to the old IP address due to DNS caching issues. This isn't an application bug but rather a DNS problem.

9. Test From Outside Your Network: Something that works on your own computer may not work globally. Test the website using different connections like mobile data, another Wi-Fi network, a different device, or an external monitoring service. This can help identify issues like DNS caching problems, firewall rules, CDN configuration issues, or IP restrictions that might not be visible from your development environment.

10. Check Permissions: File and directory permissions can lead to unexpected production-only problems. The application might require access to directories like uploads/, cache/, storage/, or logs/. Avoid granting unnecessary permissions (e.g., 777) by understanding which user runs the application and granting only the required permissions. This principle is crucial when handling uploaded files or user-generated content.

11. Test Backups: A backup system's existence doesn't guarantee its functionality. Before relying on backups, verify that you can restore them. For a database, this could involve running a command like mysqldump database_name > backup.sql. However, the critical question isn't whether the backup file exists; rather, can the data be successfully restored to a working state? By following these steps, you can ensure a smoother deployment process and provide a better user experience once the website is live.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Beyond the game build: checking itch.io submission copy and image files

Exporting a Web build does not finish a game's submission page. Players may still lack instructions, the screenshot order may be undecided, or the supported-device description may promise more than…

  • Submission page requires additional instructions and decisions beyond game build export.
  • ITCHSUBMISSION.md outlines fields, controls, AI-use disclosure, and screenshot order.
  • JPEG image files submitted instead of required PNGs, indicating need for file correction.

Why Your Engineering Resume Gets Rejected by the ATS (And How to Fix It in 20 Minutes)

Why Your Engineering Resume Gets Rejected by the ATS (And How to Fix It in 20 Minutes) You can be the perfect candidate for a role and never get a callback — because no human ever saw your resume.

  • ATS parses resumes into specific fields, causing formatting issues
  • Multi-column layouts, tables, and graphics confuse ATS parser
  • Use single-column layout, standard fonts, and simple section headers

More from Tuesday 29 September →