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

I Built a Support Agent That Never Forgets

I Built a Support Agent That Never Forgets Every engineer knows the frustration of broken support systems. Customers repeat the same issue, agents dig through old tickets, and chatbots spit out…

  • Hindsight support agent retains information from previous interactions to address the problem.
  • System's modular design separates language processing, context management, and business logic.

A support bot that remembers: cross-channel history and escalation with Hindsight

Picture a customer with a billing problem. They start in chat and get a suggestion. A few days later they email, because the suggestion didn't work.

  • Bot remembers customer interactions across chat, email, and phone
  • Uses Hindsight, FastAPI, and Groq's language model for functionality
  • Escalates when three or more unresolved issues from same customer

More from Tuesday 29 September →