A introduction to Colossians typically treats the question of provenance – where was Paul when he wrote Colossians?
The short answer is (1) in prison, and (2) the city is unknown.
Nowadays, scholars seem to care little whether Paul was writing from Rome, Ephesus, or somewhere else. There are some historical questions, like matters of the distance between Rome and Colossae and ease of travel for Onesimus, but it hardly makes a huge impact on the interpretation of the letter (other than when such issues lead to doubting the authorship attribution).
Based on Paul’s ability to be in contact with various people, the presumption of collaboration in writing, and some evidence from Acts, I am inclined to think he was in a rather flexible situation – perhaps under house arrest (in Rome? See Acts 28:16). For Paul to “live by himself” does not mean he lived a charmed life. Under guard, he may have even been shackled, which may means that his reference to “chains” (4:18) in Colossians could be literal. Not to mention to mental and emotional stress and trauma of confinement and an uncertain future.
In my commentary, I try to make flesh out how his themes of joy and thanksgiving would have been all the more an act of will as it was an emotion and reaction, given his circumstances. I don’t think it has been explored how Paul’s “prison letters” (Eph, Col, Phil, Phm) are unique among the Pauline corpus precisely because he is under such trying circumstances and is thinking more about death, shame, weakness, and hope.