The first occasion on which we read of a prison is in the history of Joseph in Egypt. Then Potiphar, "Joseph's master, took him, and put him into the prison, a place where the king's prisoners were bound" (Gen. 39:20-23). The Heb. word here used (sohar) means properly a round tower or fortress. It seems to have been a part of Potiphar's house, a place in which state prisoners were kept.
The Mosaic law made no provision for imprisonment as a punishment. In the wilderness two persons were "put in ward" (Lev. 24:12; Num. 15:34), but it was only till the mind of God concerning them should be ascertained. Prisons and prisoners are mentioned in the book of Psalms (69:33; 79:11; 142:7). Samson was confined in a Philistine prison (Judg. 16:21, 25). In the subsequent history of Israel frequent references are made to prisons (1 Kings 22:27; 2 Kings 17:4; 25:27, 29; 2 Chr. 16:10; Isa. 42:7; Jer. 32:2). Prisons seem to have been common in New Testament times (Matt. 11:2; 25:36, 43). The apostles were put into the "common prison" at the instance of the Jewish council (Acts 5:18, 23; 8:3); and at Philippi Paul and Silas were thrust into the "inner prison" (16:24; comp. 4:3; 12:4, 5).
Easton's Bible Dictionary. M.G. Easton. 1897.